[Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression '(Wall_ID=? AND Wall_Order=? AND Wall_Title=? AND Wall_Alt=? AND 1280_Size=? AND 1024_Size=? AND 800_Size=? AND 640_Size=? AND Wall_Filename_Common=? )'.
action_delete_wallpapers.asp, line 40
Is the error details when I try to delete a record from the DB.
Code (virtually identical to other action_delete files which work fine):
Response.Buffer = True
'Read in the record to be deleted
lngRecordNo = CLng(Request.Form("WallID"))
Set rsConfig = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblWallpapers.* FROM tblWallpapers WHERE tblWallpapers.Wall_ID = " & lngRecordNo & ";"
'Set the lock type so that the record is locked by ADO when it is deleted
rsConfig.LockType = 3
rsConfig.Open strSQL, adoCon
'THE FOLLOWING ARE TEST LINES TO SEE IF IT'S GETTING THE CORRECT RECORD:
Response.Write("ID: " & rsConfig("Wall_ID") & "<br>")
Response.Write("Order: " & rsConfig("Wall_Order") & "<br>")
Response.Write("Title: " & rsConfig("Wall_Title") & "<br>")
Response.Write("Alt: " & rsConfig("Wall_Alt") & "<br>")
Response.Write("1280: " & rsConfig("1280_Size") & "<br>")
Response.Write("1024: " & rsConfig("1024_Size") & "<br>")
Response.Write("800: " & rsConfig("800_Size") & "<br>")
Response.Write("640: " & rsConfig("640_Size") & "<br>")
Response.Write("Filename: " & rsConfig("Wall_Filename_Common") & "<br>")
'Delete the record from the database
rsConfig.Delete
'THIS IS IN to stop the script before it redirects to the confirmation page.
Response.End
If I move the "response.end" to before the rsConfig.Delete statement, the error is not reported (ie it's the delete bit where the problem arises)
The Response.Write test lines all bring back and write the correct information, ie, the form has asked for the correct record to delete and the strSQL statement has found the record just fine.
Help!!