Can't open database file

  • Thread starter Thread starter Jon Cosby
  • Start date Start date
J

Jon Cosby

I'm unable to open an Access database. When I try to access it I get the
message "The Microsoft Jet database engine cannot open the file
C:\Databases\Joes.mdb'. It is already opened exclusively by another user, or
you need permission to view its data".

I have the userName set to "System" and the password to "AutoGenerate" in
the <processModel> section of machine.config. In the Web.config file, I have
set impersonation to true with the line

<identity impersonate="true" />

I even granted ASPNet full control in the security settings for the db file.
I don't see anything else to try in the documentation. I don't have these
problems in other Access databases. Can someone help me out?


Jon Cosby
 
Hi, Jon Cosby,

It is not necessary to impersonate a user in order to access a file or
establish connection to a file database. You should check which is the user
the code runs as in the context. Then simply grant this user the appropriate
rights for the file.

Either debug your code to see what is the value of
System.Security.Principal.WindowsIdentity.GetCurrent().Name or simply
Response.Write it to the browser.

Hope this helps
Martin
 
Back
Top