views:

904

answers:

5

I have written a simple delete query

delete from mails

While I execute I get no problem and the query runs fine, but when I publish the website I get an error stating:

"Could not delete from specified tables"

What might be the problem?

I am getting this error when placed in IIS but when i run it in local drive through visual studio i am not getting this error...please help

A: 

Does the database have the proper permisions setup? Have you verified you are able to connect to the database?

schooner
i am using Access database...yes i can connect to database...
Girish1984
Do you have read write access to the file where it is published? Has it perhaps be flagged read only?
schooner
yes i do have read\write access to the file
Girish1984
A: 

Have a look at this link

http://support.microsoft.com/kb/240098

Huzefa
Shouldn't matter on a single table delete. And, frankly, much as I appreciate the way DISINCTROW can make non-editable queries editable, I think one should avoid Jet-specific SQL as much as possible, since that will break if you change to a different back end database.
David-W-Fenton
+1  A: 

I doubt publishing a site can affect DB code functioning. Are you able to fetch data from the database, or does no database code work after publishing ?

Have you tried following this link? I am not sure if it solves your problem, but worth a try !

http://bytes.com/groups/asp/658763-could-not-delete-specified-tables

Preets
Actually am using SQL server database.i will first empty access database by using the delete query and insert records from sql server to access...i was able to fetch records from SQL database..hope u got wat am trying to say
Girish1984
http://bytes.com/groups/asp/658763-could-not-delete-specified-tables
Preets
A: 

I would check the ConnectionString of that data source. Check if the file is available in the directory you point to. Check also, if the Network Service account has the permission to change that file.

splattne
A: 

It is necessary for the user to have read, write and delete permissions on the directory where the Access database resides, because of the lock file (.ldb).

Remou
i have given read\write permissions for the .mdb file but still i get this error
Girish1984
It is necessary to have permissions on the folder in which the mdb is stored. The lock file (ldb) must be created on the first user in and deleted on the last user out and if there is any trouble, you can end up with a read-only database, no matter what the other permissions are.
Remou
DELETE permission is not necessary. If the LDB is not deleted it causes no issues unless the LDB gets corrupted. Removing DELETE permission on the folder protects the main data file from deletion and changes LDB behavior to be like it was in Access 2 and before. You'd likely put your admini users in an NTFS user group that has DELETE permission in order that they can compact the data file (which requires a delete).
David-W-Fenton