Click to See Complete Forum and Search --> : Internet Database Problem


Astinite
February 7th, 2000, 04:18 PM
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.

Cakkie
February 8th, 2000, 04:42 AM
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
slisse@planetinternet.be

The best way to escape a problem, is to solve it.

Astinite
February 9th, 2000, 09:37 AM
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.

Cakkie
February 10th, 2000, 12:29 AM
Can you add or modify records? The database might be read-only, or it just doesn't allow users to delete records.

Tom Cannaerts
slisse@planetinternet.be

The best way to escape a problem, is to solve it.