Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error in UPDATE line

Status
Not open for further replies.

chaos986

Programmer
Sep 22, 2000
4
US
I'm trying to update an ACCESS form when a form is submitted. I've looked over it for a few days and can't find a solution that satifies the surver.

The problem line is: objConn.Execute("UPDATE Questions SET question = '" & question & "' WHERE ContentPage = '" & ContentPage & "' QNumb = '" & QNumb & "' ;")

The error i get is:


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ContentPage = 'airbladder' QNumb = '3''.




Mike2
chaos986@yahoo.com
http//also see my small busness work @ http:/
 
Try this:

objConn.Execute("UPDATE Questions SET question = '" & question & "' WHERE ContentPage = '" & ContentPage & "' AND QNumb = '" & QNumb & "' ;")

You might also find that you still get an error if your QNumb field is a number type. This is because you have quotes around the value of this field, but number types do not need this. If this is the case, try this:

objConn.Execute("UPDATE Questions SET question = '" & question & "' WHERE ContentPage = '" & ContentPage & "' AND QNumb = " & QNumb & ";")

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top