Me again...
I have selected a recordset then passed its corresponding ID along to another page, where I then intend to delete the record.
Here is my current code:
It runs but I get an 8000405 error 'Could not delete from specified tables'
I know deltarget is correct, and that a record exists with that ID.
The ID field is an autonumber field and also the primary key.
Any ideas why the above fails?
I have selected a recordset then passed its corresponding ID along to another page, where I then intend to delete the record.
Here is my current code:
Code:
deltarget=CInt(Request.Querystring) 'sent as link.asp?4 for example
strConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\[URL unfurl="true"]wwwroot\Refman\refdb.mdb"[/URL]
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open strConnectionString
sql="DELETE * FROM reftable WHERE ID=" &deltarget& ";"
cnn.Execute sql
cnn.close
Set cnn=nothing
It runs but I get an 8000405 error 'Could not delete from specified tables'
I know deltarget is correct, and that a record exists with that ID.
The ID field is an autonumber field and also the primary key.
Any ideas why the above fails?