Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default SQL Nightmare

    Everytime I try to add a record to my database, I get the following error:

    Error Diagnostic Information

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

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
    query expression ''January ,'', 'January', '', '', '','January'.

    The error occurred while processing an element with a general identifier of
    (CFQUERY), occupying document position (7:1) to (7:57).

    Here is my code snippet: Can anyone help!?!

    <cfset newPK = "#CreateUUID()#">
    <cfset currentDate = "#Month(Now())#" & "/" & "#Day(Now())#" & "/" &
    "#Year(Now())#">

    <cfparam name="Form.appAddress2" default="">
    <cfparam name="Form.appSchoolAddress2" default="">

    <cfquery name="addApplication" datasource="stakeFriends">
    INSERT INTO myApplications VALUES ('#newPK#', '#currentDate#', 'NO',
    '#Form.appFName#', '#Form.appLName#', '#Form.appGender#', '#Form.appAge#',
    '#Form.appDOBM#', '#Form.appDOBD#', '#Form.appDOBY#', '#Form.appIDTYPE#',
    '#Form.appIDNUM#', '#Form.appHEIGHTF#', '#Form.appHEIGHTI#',
    '#Form.appWEIGHT#', '#Form.appHAIR#', '#Form.appEYE#', '#Form.appEthnicity#',
    '#Form.appEMAIL#', '#Form.appAddress1#', '#Form.appAddress2#',
    '#Form.appCity#', '#Form.appZIP#', '#Form.appPhone#', '#Form.appCellPhone#',
    '#Form.appCALLTIME#', '#Form.appParent#', '#Form.appLanguage#',
    '#Form.appLanguageApt#', '#Form.appSCHOOLTYPE#', '#Form.appSchoolName#',
    '#Form.appSchoolAddress1#', '#Form.appSchoolAddress2#', '#Form.appSchoolCity#',
    '#Form.appSchoolZIP#', '#Form.appSchoolTime#', '#Form.appSchoolMiles#',
    '#Form.appTOBACCOUSE#', '#Form.appTOBACCOPROGRAMS#', '#Form.appProgramName#',
    '#Form.appProgramDescription#', '#Form.appTOBACCOPARTM#',
    '#Form.appTOBACCOPARTY#', '#Form.appActivityName1#',
    '#Form.appActivityPosition1#',
    '#Form.appActivityMonthFrom1#', '#Form.appActivityYearFrom1#',
    '#Form.appActivityMonthTo1#', '#Form.appActivityYearTo1#',
    '#Form.appActivityName2#',
    '#Form.appActivityPosition2#','#Form.appActivityMo nthFrom2#
    ,'#Form.appActivityYearFrom2#', '#Form.appActivityMonthTo2#',
    '#Form.appActivityYearTo2#', '#Form.appActivityName3#',
    '#Form.appActivityPosition3#','#Form.appActivityMo nthFrom3#
    ,'#Form.appActivityYearFrom3#', '#Form.appActivityMonthTo3#',
    '#Form.appActivityYearTo3#')
    </cfquery>

    KGIRLCFDEVELOPER Guest

  2. Similar Questions and Discussions

    1. Nightmare SOLVED!!!
      I have no idea how or why these registry permissions are a problem, but I do know that the following actions resolved the problems and allowed Flash...
    2. Is IE7 an end to the nightmare?
      I've been considering installing Internet Explorer 7 in hopes that it might solve the Flash installation bug. Generally, I'm reluctant to go with...
    3. eps nightmare
      hi, hope you all can help me. I'm having problems with exporting .eps from illu 10 on the pc. Basically Im placing images which are linked....
    4. Printing still a nightmare...
      Has anyone EVER been able to get sharp lines + beautiful vibrant color in AI 10/Mac OS 10.2.8? I have to print in AI 8 out of Mac OS 9 to get this,...
    5. apt-get nightmare
      I'm trying to upgrade a laptop and I get the following error. Removing gnome-control-center dpkg: error processing gnome-control-center...
  3. #2

    Default Re: SQL Nightmare

    Missing a '

    '#Form.appActivityMonthFrom2# ,

    Should be:

    '#Form.appActivityMonthFrom2#' ,


    --
    Ken Ford
    PVII Support Team
    [url]http://www.projectseven.com[/url]
    Team Macromedia Volunteer - Dreamweaver
    Certified Dreamweaver MX 2004 Developer


    "KGIRLCFDEVELOPER" <webforumsuser@macromedia.com> wrote in message news:d11v1m$71t$1@forums.macromedia.com...
    > Everytime I try to add a record to my database, I get the following error:
    >
    > Error Diagnostic Information
    >
    > ODBC Error Code = 37000 (Syntax error or access violation)
    >
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
    > query expression ''January ,'', 'January', '', '', '','January'.
    >
    > The error occurred while processing an element with a general identifier of
    > (CFQUERY), occupying document position (7:1) to (7:57).
    >
    > Here is my code snippet: Can anyone help!?!
    >
    > <cfset newPK = "#CreateUUID()#">
    > <cfset currentDate = "#Month(Now())#" & "/" & "#Day(Now())#" & "/" &
    > "#Year(Now())#">
    >
    > <cfparam name="Form.appAddress2" default="">
    > <cfparam name="Form.appSchoolAddress2" default="">
    >
    > <cfquery name="addApplication" datasource="stakeFriends">
    > INSERT INTO myApplications VALUES ('#newPK#', '#currentDate#', 'NO',
    > '#Form.appFName#', '#Form.appLName#', '#Form.appGender#', '#Form.appAge#',
    > '#Form.appDOBM#', '#Form.appDOBD#', '#Form.appDOBY#', '#Form.appIDTYPE#',
    > '#Form.appIDNUM#', '#Form.appHEIGHTF#', '#Form.appHEIGHTI#',
    > '#Form.appWEIGHT#', '#Form.appHAIR#', '#Form.appEYE#', '#Form.appEthnicity#',
    > '#Form.appEMAIL#', '#Form.appAddress1#', '#Form.appAddress2#',
    > '#Form.appCity#', '#Form.appZIP#', '#Form.appPhone#', '#Form.appCellPhone#',
    > '#Form.appCALLTIME#', '#Form.appParent#', '#Form.appLanguage#',
    > '#Form.appLanguageApt#', '#Form.appSCHOOLTYPE#', '#Form.appSchoolName#',
    > '#Form.appSchoolAddress1#', '#Form.appSchoolAddress2#', '#Form.appSchoolCity#',
    > '#Form.appSchoolZIP#', '#Form.appSchoolTime#', '#Form.appSchoolMiles#',
    > '#Form.appTOBACCOUSE#', '#Form.appTOBACCOPROGRAMS#', '#Form.appProgramName#',
    > '#Form.appProgramDescription#', '#Form.appTOBACCOPARTM#',
    > '#Form.appTOBACCOPARTY#', '#Form.appActivityName1#',
    > '#Form.appActivityPosition1#',
    > '#Form.appActivityMonthFrom1#', '#Form.appActivityYearFrom1#',
    > '#Form.appActivityMonthTo1#', '#Form.appActivityYearTo1#',
    > '#Form.appActivityName2#',
    > '#Form.appActivityPosition2#','#Form.appActivityMo nthFrom2#
    > ,'#Form.appActivityYearFrom2#', '#Form.appActivityMonthTo2#',
    > '#Form.appActivityYearTo2#', '#Form.appActivityName3#',
    > '#Form.appActivityPosition3#','#Form.appActivityMo nthFrom3#
    > ,'#Form.appActivityYearFrom3#', '#Form.appActivityMonthTo3#',
    > '#Form.appActivityYearTo3#')
    > </cfquery>
    >

    Ken Ford - *TMM* & PVII Guest

  4. #3

    Default Re: SQL Nightmare

    Missing one here too:

    '#Form.appActivityMonthFrom3# ,

    Should be:

    '#Form.appActivityMonthFrom3#' ,


    --
    Ken Ford
    PVII Support Team
    [url]http://www.projectseven.com[/url]
    Team Macromedia Volunteer - Dreamweaver
    Certified Dreamweaver MX 2004 Developer


    "Ken Ford - *TMM* & PVII" <kford@projectseven.com> wrote in message news:d11vll$7qj$1@forums.macromedia.com...
    > Missing a '
    >
    > '#Form.appActivityMonthFrom2# ,
    >
    > Should be:
    >
    > '#Form.appActivityMonthFrom2#' ,
    >
    >
    > --
    > Ken Ford
    > PVII Support Team
    > [url]http://www.projectseven.com[/url]
    > Team Macromedia Volunteer - Dreamweaver
    > Certified Dreamweaver MX 2004 Developer
    >
    >
    > "KGIRLCFDEVELOPER" <webforumsuser@macromedia.com> wrote in message news:d11v1m$71t$1@forums.macromedia.com...
    >> Everytime I try to add a record to my database, I get the following error:
    >>
    >> Error Diagnostic Information
    >>
    >> ODBC Error Code = 37000 (Syntax error or access violation)
    >>
    >> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
    >> query expression ''January ,'', 'January', '', '', '','January'.
    >>
    >> The error occurred while processing an element with a general identifier of
    >> (CFQUERY), occupying document position (7:1) to (7:57).
    >>
    >> Here is my code snippet: Can anyone help!?!
    >>
    >> <cfset newPK = "#CreateUUID()#">
    >> <cfset currentDate = "#Month(Now())#" & "/" & "#Day(Now())#" & "/" &
    >> "#Year(Now())#">
    >>
    >> <cfparam name="Form.appAddress2" default="">
    >> <cfparam name="Form.appSchoolAddress2" default="">
    >>
    >> <cfquery name="addApplication" datasource="stakeFriends">
    >> INSERT INTO myApplications VALUES ('#newPK#', '#currentDate#', 'NO',
    >> '#Form.appFName#', '#Form.appLName#', '#Form.appGender#', '#Form.appAge#',
    >> '#Form.appDOBM#', '#Form.appDOBD#', '#Form.appDOBY#', '#Form.appIDTYPE#',
    >> '#Form.appIDNUM#', '#Form.appHEIGHTF#', '#Form.appHEIGHTI#',
    >> '#Form.appWEIGHT#', '#Form.appHAIR#', '#Form.appEYE#', '#Form.appEthnicity#',
    >> '#Form.appEMAIL#', '#Form.appAddress1#', '#Form.appAddress2#',
    >> '#Form.appCity#', '#Form.appZIP#', '#Form.appPhone#', '#Form.appCellPhone#',
    >> '#Form.appCALLTIME#', '#Form.appParent#', '#Form.appLanguage#',
    >> '#Form.appLanguageApt#', '#Form.appSCHOOLTYPE#', '#Form.appSchoolName#',
    >> '#Form.appSchoolAddress1#', '#Form.appSchoolAddress2#', '#Form.appSchoolCity#',
    >> '#Form.appSchoolZIP#', '#Form.appSchoolTime#', '#Form.appSchoolMiles#',
    >> '#Form.appTOBACCOUSE#', '#Form.appTOBACCOPROGRAMS#', '#Form.appProgramName#',
    >> '#Form.appProgramDescription#', '#Form.appTOBACCOPARTM#',
    >> '#Form.appTOBACCOPARTY#', '#Form.appActivityName1#',
    >> '#Form.appActivityPosition1#',
    >> '#Form.appActivityMonthFrom1#', '#Form.appActivityYearFrom1#',
    >> '#Form.appActivityMonthTo1#', '#Form.appActivityYearTo1#',
    >> '#Form.appActivityName2#',
    >> '#Form.appActivityPosition2#','#Form.appActivityMo nthFrom2#
    >> ,'#Form.appActivityYearFrom2#', '#Form.appActivityMonthTo2#',
    >> '#Form.appActivityYearTo2#', '#Form.appActivityName3#',
    >> '#Form.appActivityPosition3#','#Form.appActivityMo nthFrom3#
    >> ,'#Form.appActivityYearFrom3#', '#Form.appActivityMonthTo3#',
    >> '#Form.appActivityYearTo3#')
    >> </cfquery>
    >>
    >
    >

    Ken Ford - *TMM* & PVII Guest

  5. #4

    Default Re: SQL Nightmare

    I miss the the table cols where You want to enter these Values.
    A SQL Syntax like this must be e.g.:

    Insert into MyApplications (1,3,4,) Values ('1','2','3');
    or
    insert into MyApplications set 1='1', 2='2', 3='3';

    SQL isn't a real good friend if you now to handle it ;)

    Der Nickname Guest

  6. #5

    Default Re: SQL Nightmare

    Originally posted by: Der Nickname I miss the the table cols where You want to
    enter these Values. A SQL Syntax like this must be e.g.: Insert into
    MyApplications (1,3,4,) Values ('1','2','3'); or insert into MyApplications set
    1='1', 2='2', 3='3'; If you specify the VALUES in the same order like the
    cols of your table, you can use the shorter Syntax: INSERT INTO tablename
    VALUES ('first-field','second-field') - so the Treatstarters Syntax is ok. :-)
    cu

    Dorian_Laird Guest

  7. #6

    Default Re: SQL Nightmare

    If so, It also should work. ;)
    I just tell you how I learned it and in that way I never got any problems with SQL.

    Der Nickname Guest

Posting Permissions

  • You may not post new threads
  • You may 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