Cfquery Update Syntax Suddenly bad???

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

  1. #1

    Default Cfquery Update Syntax Suddenly bad???

    The following code has been working for 2yrs or so;

    And suddenly I get the following error;

    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
    Access Driver] Syntax error in UPDATE statement.

    The error occurred in C:\Inetpub\wwwroot\seaboard\CartweaverPO.cfm: line 61
    Called from C:\Inetpub\wwwroot\seaboard\ProcessOrder.cfm: line 36
    Called from C:\Inetpub\wwwroot\seaboard\CartweaverPO.cfm: line 61
    Called from C:\Inetpub\wwwroot\seaboard\ProcessOrder.cfm: line 36

    59 : ,howUheard='#form.howUheard#'
    60 : ,'mailCheck='#form.mailCheck#'
    61 : WHERE CustomerID=#form.CustomerID#;
    62 : </cfquery>
    63 : </cfif>

    SQL UPDATE Customers SET CompanyName = 'The Visual Spectrum' ,FirstName =
    'Henry' ,LastName = 'Silvia' ,Address1 = '4432 Commercial Way' ,Address2 = ''
    ,City = 'Spring Hill' ,StateOrProv = 'FL' ,Zip = '34608' ,Country = 'United
    States' ,ShpAddress1 = '14567 Hoobi Doobi Lane' ,ShpCity = 'Brooksville'
    ,ShpStateOrProv = 'FL' ,ShpZip = '34606' ,ShpCountry = 'United States'
    ,PhoneNumber = '352-597-4395' ,FaxNumber = '597-5991' ,EmailAddress =
    'hgs@visualspectrum.com' ,Notes = '' ,CCardType = 'v' ,CCNumber =
    '411111111111' ,ExprMonth = '01' ,ExprYr = '2008' ,permission = 'no'
    ,poNumber='' ,howUheard='Customer did not answer' ,'mailCheck='no' WHERE
    CustomerID=2201;

    Every line has a comma except the last. The WHERE does referrence a ID field
    (Number, MSAccess) and yet I get Syntax error with no clue what is
    syntactically wrong. Any clues?

    <cfquery name="updateCust" datasource="SeaboardCart" dbtype="odbc">
    UPDATE Customers
    SET CompanyName = '#form.CompanyName#'
    ,FirstName = '#form.FirstName#'
    ,LastName = '#form.LastName#'
    ,Address1 = '#form.Address1#'
    ,Address2 = '#form.Address2#'
    ,City = '#form.City#'
    ,StateOrProv = '#form.StateOrProv#'
    ,Zip = '#form.Zip#'
    ,Country = '#form.Country#'
    ,ShpAddress1 = '#form.ShpAddress1#'
    ,ShpCity = '#form.ShpCity#'
    ,ShpStateOrProv = '#form.ShpStateOrProv#'
    ,ShpZip = '#form.ShpZip#'
    ,ShpCountry = '#form.ShpCountry#'
    ,PhoneNumber = '#form.PhoneNumber#'
    ,FaxNumber = '#form.FaxNumber#'
    ,EmailAddress = '#form.EmailAddress#'
    ,Notes = '#form.Notes#'
    ,CCardType = '#form.CCardType#'
    ,CCNumber = '#form.CCNumber#'
    ,ExprMonth = '#form.ExprMonth#'
    ,ExprYr = '#form.ExprYr#'
    ,permission = '#form.permission#'
    ,poNumber='#form.poNumber#'
    ,howUheard='#form.howUheard#'
    ,'mailCheck='#form.mailCheck#'
    WHERE CustomerID=#form.CustomerID#;
    </cfquery>

    bigbrain28 Guest

  2. Similar Questions and Discussions

    1. MS Access UPDATE not updating with cfquery
      Three columns will update (GolaCalls, GoalContacts, and GoalAppts). However, the two columns FirstName and LastName remain unchanged even if there...
    2. Results of update in CFQUERY
      And what about delete? Seems like delete does not return anything neither.
    3. Error executing a cfquery update statement. PLEASE HELP
      I have been over and over this. I am trying to update a simple table. I took this script from the same server using a different DSN. I keep...
    4. <cfquery> syntax problem
      Guys can someone tell me whats wrong with the line I have put in bold? Im trying to run this query but I get an error telling me the syntax is wrong...
    5. Update syntax
      Hi Please excuse if repeat question. Is it possible using dreamweavers 'Update Recordset' server behaviour to access the mysql syntax, in...
  3. #2

    Default Re: Cfquery Update Syntax Suddenly bad???

    Hi bigbrain28,

    howUheard='Customer did not answer' ,'mailCheck='no' WHERE

    How did that comma get before the mailCheck field?
    philh Guest

  4. #3

    Default Re: Cfquery Update Syntax Suddenly bad???

    WOW, Eagle-Eye-Phil! Thanks man! I looked at that code 'til I was cross-eyed and never saw that extra quote. I wonder where that came from??? Well, It works now, so thanks.
    bigbrain28 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