Error opening connection to Access (Jet) DB

  • Thread starter Thread starter Burton Roberts
  • Start date Start date
B

Burton Roberts

When using ASP.NET and an OleDBConnection control I get this error on
CNN.Open:

"The Microsoft Jet database engine cannot open the file
'C:\A2K\Backups\EdsBe2K.mdb'. It is already opened exclusively by another
user, or you need permission to view its data."

I have tried using a connection string, too, to no avail.

However, when I am in Windows Forms I have no problem opening the same file
using a connection control or connection string. There's no security on the
EdsBe2K.mdb file.

Thanks
 
The most likely cause of this problem is the default ASPNET user account not
having permission to access that folder.
Grant the user account access or use Impersonation to have it run under
another user account that does have permission.
For testing purposes you can have it run under your personal user account
since that is what's probably being used successfully in your successful
WinForms test.
Here's more info:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
 
Thanks!


Steve C. Orr said:
The most likely cause of this problem is the default ASPNET user account
not having permission to access that folder.
Grant the user account access or use Impersonation to have it run under
another user account that does have permission.
For testing purposes you can have it run under your personal user account
since that is what's probably being used successfully in your successful
WinForms test.
Here's more info:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
 
Hi Burton,

Make sure the current user (e.g., ASPNET account) has sufficient permissions
(Change) in the directory where the .mdb file is located.

Access needs to open a locking (.ldb) file, so more than just read
permission is required.

Let us know if this gets you moving?

Ken
Microsoft MVP [ASP.NET]
 
Hi, Ken
It's working. But I think this had to do with the oledb connection control
on the design surface. When I deleted it and used the string everything
worked, but I had to delete the connection control, or so it seemed. Then I
put the connection control back in, just to see, but everything still
worked. So I'm not sure why it's working now. But I didn't touch the
permissions in the folder.
Thanks

Ken Cox said:
Hi Burton,

Make sure the current user (e.g., ASPNET account) has sufficient
permissions (Change) in the directory where the .mdb file is located.

Access needs to open a locking (.ldb) file, so more than just read
permission is required.

Let us know if this gets you moving?

Ken
Microsoft MVP [ASP.NET]

Burton Roberts said:
When using ASP.NET and an OleDBConnection control I get this error on
CNN.Open:

"The Microsoft Jet database engine cannot open the file
'C:\A2K\Backups\EdsBe2K.mdb'. It is already opened exclusively by another
user, or you need permission to view its data."

I have tried using a connection string, too, to no avail.

However, when I am in Windows Forms I have no problem opening the same
file using a connection control or connection string. There's no security
on the EdsBe2K.mdb file.

Thanks
 
Back
Top