I'm trying to insert a record having only one field, VOTER_ID, into a Holding Table before the record is actually deleted from a main table. I just can't get this code to work. (I'm getting a Syntax error from ASP)Can anybody eyeball it and see where the error is?
------
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Open
Call ReportError
for i=1 to request.form("mdelete").count
ind = CInt(request.form("mdelete")(i))
strSQL = "Insert INTO HoldingTable(VOTER_ID) from " & strTableName & " where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(request.form("mdelete1")(ind), "'", "''") & gstrQuote
dbConnection.Execute strSQL
strSQL="delete from " & strTableName & _
" where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(request.form("mdelete1")(ind), "'", "''") & gstrQuote
if strKeyField2<>"" then _
strSQL = strSQL & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(request.form("mdelete2")(ind), "'", "''") & gstrQuote2
if strKeyField3<>"" then _
strSQL = strSQL & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(request.form("mdelete3")(ind), "'", "''") & gstrQuote3
------
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Open
Call ReportError
for i=1 to request.form("mdelete").count
ind = CInt(request.form("mdelete")(i))
strSQL = "Insert INTO HoldingTable(VOTER_ID) from " & strTableName & " where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(request.form("mdelete1")(ind), "'", "''") & gstrQuote
dbConnection.Execute strSQL
strSQL="delete from " & strTableName & _
" where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(request.form("mdelete1")(ind), "'", "''") & gstrQuote
if strKeyField2<>"" then _
strSQL = strSQL & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(request.form("mdelete2")(ind), "'", "''") & gstrQuote2
if strKeyField3<>"" then _
strSQL = strSQL & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(request.form("mdelete3")(ind), "'", "''") & gstrQuote3