Update Query...

Malespissus

New Member
Hi, I get an error message on an Update command.<BR><BR>Before this command u do an insert command and that just works fine. The query looks just fine too.<BR><BR>Please help me out:<BR><BR>Here is the code:<BR><BR>'strUpdate = "Update Pollanswer Set Count=" & PACount & " Where ID=" & PAID<BR> strUpdate = "Update PollAnswer Set Count=1 Where ID=3"<BR> Response.Write(strUpdate)<BR> <BR> cmdUpdate = New OleDbCommand(strUpdate, conCommunity)<BR> cmdUpdate.ExecuteNonQuery()<BR><BR>The error I get is:<BR><BR>Exception Details: System.Data.OleDb.OleDbException: Syntax error in UPDATE statement.Does IUSR have write-permissions on the .mdb file?No, I can insert into the database so thats not the problemCould it be that you're using "Count" as a fieldname? Isn't that a reserved word in SQL?COUNT is a reserved keyword. Change the field name to theCount or either enclose the fieldname in quotes in your Update query.<BR>Ok thanks. How stupid of me, it works just fine now.
 
Back
Top