Skip to main content
Inspiring
June 14, 2006
Answered

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?
This topic is closed to new replies. Start a new post to keep the conversation going.
bigbrain28Correct answer
Inspiring
June 14, 2006
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.

2 replies

bigbrain28AuthorCorrect answer
Inspiring
June 14, 2006
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.
Translate
Inspiring
June 14, 2006
Hi bigbrain28,

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

How did that quote (NOT comma) get before the mailCheck field?
Translate