I am using the following code snippet to delete a record from an Access database:
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("personal.mdb"))
sql="DELETE * FROM plant_list"
sql=sql & " WHERE plant_id=" & request.QueryString("entry")
response.Write(sql)
response.write("<br />")
on error resume next
conn.Execute sql
if err<>0 then
response.write err.description
else
response.write("Record " & request.QueryString("entry") & " was deleted!")
end if
conn.close
%>
I did NOT set any password on the database through Access.
I get the following error:
"Could not delete from specified tables."
I did a response.write (sql) to make sure the query was properly formatted. It returned:
"DELETE * FROM plant_list WHERE plant_id=18"
The database exists, the table exists, the field exists, as does record id 18.
The database has all permissions on the server.
What am I doing wrong?
Any help is appreciated! Thanks.