Professional Web Applications Themes

ODBC 37000 error - Coldfusion Database Access

:confused; I'm getting the following error: ODBC Error Code = 37000 (Syntax error or access violation) [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. SQL = "INSERT INTO Healthcare_Catalog( Program_Name, Program_Web, Program_Description, Provider_Name_Short, School, Location_City, Location_State, Program_Notes, Program_Contact, Contact_Email, Contact_Phone, Distance, Degree_Level, Attendance_Options, Length_of_Program, Length_of_Program_Years, Occupational_Information, Rural_Opportunities, Admission_Prerequisites, Rural, Focus_Program) VALUES ( 'testone', '', '', 'ACNM', 35, '', '', '', '', '', '', 'Didatic Only', 'AA', 'Full Time', '< year (0-10 days)', , '', '', '', 'no', 'no')" Data Source = "AKHC" The error occurred while processing an element with a general identifier of (CFQUERY), occupying doent position ...

  1. #1

    Default ODBC 37000 error

    :confused;
    I'm getting the following error:


    ODBC Error Code = 37000 (Syntax error or access violation)

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    statement.

    SQL = "INSERT INTO Healthcare_Catalog( Program_Name, Program_Web,
    Program_Description, Provider_Name_Short, School, Location_City,
    Location_State, Program_Notes, Program_Contact, Contact_Email, Contact_Phone,
    Distance, Degree_Level, Attendance_Options, Length_of_Program,
    Length_of_Program_Years, Occupational_Information, Rural_Opportunities,
    Admission_Prerequisites, Rural, Focus_Program) VALUES ( 'testone', '', '',
    'ACNM', 35, '', '', '', '', '', '', 'Didatic Only', 'AA', 'Full Time', '< year
    (0-10 days)', , '', '', '', 'no', 'no')"

    Data Source = "AKHC"

    The error occurred while processing an element with a general identifier of
    (CFQUERY), occupying doent position (3:2) to (3:37) in the template file
    D:\Inetpub\dist-web\users\sagea\health_careers\sessions\program_in sert.cfm.

    Apparently from this code:

    <cfquery datasource="#data_source#">
    INSERT INTO Healthcare_Catalog(
    Program_Name,
    Program_Web,
    Program_Description,
    Provider_Name_Short,
    School,
    Location_City,
    Location_State,
    Program_Notes,
    Program_Contact,
    Contact_Email,
    Contact_Phone,
    Distance,
    Degree_Level,
    Attendance_Options,
    Length_of_Program,
    Length_of_Program_Years,
    Occupational_Information,
    Rural_Opportunities,
    Admission_Prerequisites,
    Rural,
    Focus_Program)
    VALUES (
    '#SESSION.ProgWiz.Program_Name#',
    '#SESSION.ProgWiz.Program_Web#',
    '#SESSION.ProgWiz.Program_Description#',
    '#SESSION.ProgWiz.Provider_Name_Short#',
    #SESSION.ProgWiz.School#,

    '#SESSION.ProgWiz.Location_City#',
    '#SESSION.ProgWiz.Location_State#',
    '#SESSION.ProgWiz.Program_Notes#',
    '#SESSION.ProgWiz.Program_Contact#',
    '#SESSION.ProgWiz.Contact_Email#',
    '#SESSION.ProgWiz.Contact_Phone#',
    '#SESSION.ProgWiz.Distance#',
    '#SESSION.ProgWiz.Degree_Level#',
    '#SESSION.ProgWiz.Attendance_Options#',
    '#SESSION.ProgWiz.Length_of_Program#',
    #SESSION.ProgWiz.Length_of_Program_Years#,
    '#SESSION.ProgWiz.Occupational_Information#',
    '#SESSION.ProgWiz.Rural_Opportunities#',
    '#SESSION.ProgWiz.Admission_Prerequisites#',
    '#SESSION.ProgWiz.Rural#',
    '#SESSION.ProgWiz.Focus#')
    </cfquery>

    I'm not sure what the problem is. Can anyone help me out?

    Thanks,
    S./




    sage703 Guest

  2. #2

    Default Re: ODBC 37000 error

    For one thing it looks like you're missing a value ...

    '< year (0-10 days)' , (missing ), '', '', '', 'no', 'no'
    mxstu Guest

  3. #3

    Default Re: ODBC 37000 error

    That happens because I don't put a value in the field for some reason (that's
    something i can fix later i think). So this time I put a numeric value in the
    field, as the database requires and yet I still got an error (very similar):

    ODBC Error Code = 22005 (Error in assignment)

    [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
    expression.

    SQL = "INSERT INTO Healthcare_Catalog( Program_Name, Program_Web,
    Program_Description, Provider_Name_Short, School, Location_City,
    Location_State, Program_Notes, Program_Contact, Contact_Email, Contact_Phone,
    Distance, Degree_Level, Attendance_Options, Length_of_Program,
    Length_of_Program_Years, Occupational_Information, Rural_Opportunities,
    Admission_Prerequisites, Rural, Focus_Program) VALUES ( 'TESTONE', '', '',
    'ACNM', 35, '', '', '', '', '', '', 'Didatic Only', 'AA', 'Full Time', '1
    year', 1, '', '', '', 'no', 'no')"

    Data Source = "AKHC"

    There appears to be the right number of fields (21 to insert into and 21
    inserted). Also the only numeric fields (School, and Length_of_Program_Years
    are both input correctly (without the single ' marks around the variables). I
    seem to have a problem using INSERT INTO statements in general. When I use
    CFINSERT I have no problems generally, although I cannot use CFINSERT herre I
    don't think because I have multiple inserts from multiple forms (I'm using
    session variables and have a multiple page form screen leading up to this
    error).

    Thanks for your help,
    S./


    sage703 Guest

  4. #4

    Default Re: ODBC 37000 error

    Check your other thread.
    mxstu Guest

Similar Threads

  1. Replies: 6
    Last Post: September 2nd, 01:22 PM
  2. ODBC Error?
    By Little Alex in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: April 15th, 02:50 PM
  3. ODBC Error MX 6.1
    By northernmonkey in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: February 16th, 04:11 PM
  4. ODBC has error but no error message displayed
    By Robert Brown in forum ASP.NET General
    Replies: 2
    Last Post: July 3rd, 11:47 AM
  5. Replies: 2
    Last Post: July 1st, 02:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139