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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Multiple records 1

Status
Not open for further replies.

jedel

Programmer
Jan 11, 2003
430
AU
Hi All

I'm trying to set up a SQL that will delete multiple records but keep getting an error. Its the same code as the thread here thread181-27567.

But my problem is that I am not getting any values in the SQL at all, i get the error

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

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'AttendID IN ()'.

/knect/admin/attendees.asp, line 30


here is the Delete code

Code:
<%
if(Request("chkDel") <> "") then commDelete__intRecordsIDs = Request("chkDel")
CommDelete__intRecordIDs=Replace(CommDelete__intRecordIDs,",","','")
%>
<%
set commDelete = Server.CreateObject("ADODB.Command")
commDelete.ActiveConnection = MM_connect_STRING
commDelete.CommandText = "DELETE FROM attendanceTBL WHERE AttendID IN (" + Replace(commDelete__intRecordsIDs, "'", "''") + ")"
'response.Write("DELETE FROM attendanceTBL WHERE AttendID IN (" + Replace(commDelete__intRecordsIDs, "'", "''") + ")")
commDelete.CommandType = 1
commDelete.CommandTimeout = 0
commDelete.Prepared = true
commDelete.Execute()
%>

Any help would be appreciated.

Cheers

Dean

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
It's OK, I found it.

Stupid mistake really. I did place a condition around it so it ran when the page loaded. The code above worked nicely.

Thanks for your thoughts

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top