user67978
user67978

Reputation:

ASP.NET Access Database Error?

I have written some code that uses an Access DB, on my localhost the following - Select, Insert, and Delete queries work just fine and do what I programmed them to do. When I move the application to the staging server, the application throws errors when Inserting and deleting, however the select statements work just fine. I have made sure all permissions are read/write as far as I can tell, does anyone know what I am missing. See the error below.

~~~~~

Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information about
the error and where it originated in the code. 

Exception Details: System.Data.OleDb.OleDbException: Could not delete from
specified tables. 

Source Error: 
Line 714: OleDbDataReader objReader; 
Line 715: objConn.Open(); 
Line 716: objReader = objCmd.ExecuteReader();

Upvotes: 1

Views: 1315

Answers (4)

Arun Devadiga
Arun Devadiga

Reputation: 1

ASP.NET runs under the special ASPNET or Network Service account. Mostly IIS_USERS (located in the machine)

Right click on folder containing the file to be modified by ASP user

Folder->Properties->Security->Edit->Add IIS_IUSRS (of local machine) with upto modify permission.

Upvotes: 0

JeffO
JeffO

Reputation: 8053

Seems like whatever account is utilizing the .mdb file does not have the necessary rights to the file/folder.

I've found that using an .mdb file for a website just has too many problems. You want to switch to at least SQL Express. You website will appreciate it.

Upvotes: 0

shahkalpesh
shahkalpesh

Reputation: 33484

Is your MDB file readonly? I am talking about the file-system attribute of the MDB file.

Upvotes: 0

HardCode
HardCode

Reputation: 6765

Hmmm ... that's odd. Do you have Modify (Change) file system permissions on the staging server's folder? Hitting the .mdb would create that temp Access file, so if you can select you should have Write on that folder. Check that you have Modify.

Upvotes: 1

Related Questions