Print Page | Close Window

Drivers error ’80004005’

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3502
Printed Date: 29 March 2026 at 5:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Drivers error ’80004005’
Posted By: pedalcars
Subject: Drivers error ’80004005’
Date Posted: 13 June 2003 at 6:13am
[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!!



-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels




Replies:
Posted By: MorningZ
Date Posted: 13 June 2003 at 8:06am

why not just construct a "DELETE" statement instead of messing with all that ADO crap?

strSQL  = "DELETE FROM table WHERE blah blah blah"



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pedalcars
Date Posted: 13 June 2003 at 9:49am
I don't know, why not? OK, done this and it works, ta.

Still doesn't ease my confusion any (the above was adapted from the webwiz tutorials and the delete action in the news app) as to why one page brings back the error above while all the other pages that use seemingly identical code work fine!



-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net