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

Cannot Delete 1

Status
Not open for further replies.

fatmbk

Technical User
Jul 11, 2002
29
0
0
GB
I am getting the following message:

Error Type:
Microsoft JET Database Engine (0x80004005)
Could not delete from specified tables.
/admin_delrecord_saved.asp, line 22

My code is as follows:

<%
delid = Request.Form("delid");

conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("db/products.mdb"))

deleterec = "DELETE tblProducts.ProductID FROM tblProducts WHERE (((tblProducts.ProductID)="+delid+"))";

conn.execute(deleterec);
conn.close;
%>

Any ideas??!

Cheers!
 
try

"DELETE FROM tblProducts WHERE ProductID="&delid

assuming pproductid is numeric
 
also your connection, try like this

set conn=Server.CreateObject("ADODB.Connection")
cstr="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("db/products.mdb")& ";"
conn.open(cstr)
 
It didnt work!

productID is numeric.

There is nothing wrong with the variable - it just doesnt seem to like the statement. It doesnt seem to have the power to modify the database? IS there any setting within the database?
 
its an access db - i havent set any permissions on the database.
 
Your IUSR_MachineName probably doesnt have the correct permissions on your .mdb file.
 
Cheers, that worked - uploaded it to the web server and it worked

Thanks!
 
fatmbk, please give credit where credit is due, a lil recognition goes a long way;-)...congrats on the fix

BSL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top