|
-
February 7th, 2000, 05:18 PM
#1
Internet Database Problem
I'm having trouble deleting a row from an access database on an internet server using asp. I can select everything from it just fine but when I go to delete a row this error message comes across:
Microsoft JET Database Engine error '80004005'
Could not delete from specified tables.
Here's the code I'm using to delete a row:
set MyConn = Server.CreateObject("ADODB.Connection")
cnpath= server.mappath("Users.mdb") & ";User Id=admin;Password=;"
Myconn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= "& cnpath
SQL_query = "Delete FROM Company WHERE CompanyID= "& ID
set lRecordSet = MyConn.Execute(SQL_query)
There are no relationships set up either. Any help would be greatly appreciated.
-
February 8th, 2000, 05:42 AM
#2
Re: Internet Database Problem
All SQL statements must end with ; , your doesn't, add the character at the end of statement.
Your code should look like this
set MyConn = Server.CreateObject("ADODB.Connection")
cnpath= server.mappath("Users.mdb") & ";User Id=admin;Password=;"
Myconn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= "& cnpath
SQL_query = "Delete FROM Company WHERE CompanyID= "& ID & ";" ' <-- added ; here
set lRecordSet = MyConn.Execute(SQL_query)
I hope it works
Tom Cannaerts
[email protected]
The best way to escape a problem, is to solve it.
-
February 9th, 2000, 10:37 AM
#3
Re: Internet Database Problem
Putting the ; at the end didn't work. I still get the exact same error as before. Any other ideas? Thanks for your last input.
-
February 10th, 2000, 01:29 AM
#4
Re: Internet Database Problem
Can you add or modify records? The database might be read-only, or it just doesn't allow users to delete records.
Tom Cannaerts
[email protected]
The best way to escape a problem, is to solve it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|