An unhandled exception may occur when you try to connect to an Access database from an ASP.NET worker process (316675)
The information in this article applies to:
- Microsoft ADO.Net 2.0
- Microsoft ADO.NET (included with the .NET Framework) 1.0
- Microsoft ASP.NET (included with the .NET Framework) 1.0
- Microsoft Access 2002
- Microsoft Access 2000
- Microsoft Office FrontPage 2003
This article was previously published under Q316675 This article refers to the following Microsoft .NET
Framework Class Library namespace:
SYMPTOMS An unhandled exception may occur under the following
circumstances:
- An ASP.NET worker process (Aspnet_wp.exe) runs under the
default ASPNET account.
-and-
- You do not enable impersonation on that application.
-and-
- You try to connect to or write to an Access
database.
Under these circumstances, you may receive one of the following
exceptions: The Microsoft Jet database engine cannot
open the file 'C:\Nwind.mdb'. It is already opened exclusively by another user,
or you need permission to view its data.
Operation must use an updateable query. CAUSE Because of security concerns, the ASP.NET worker process
runs under the default ASPNET account. If you do not enable impersonation for
an application, all of the threads that run the requests for that application
run under the process account.
This problem occurs because the ASPNET
account does not have sufficient permissions to connect to or write to an
Access database. RESOLUTION To work around this problem, use one of the following
methods:
- Configure the ASP.NET worker process to run under the
SYSTEM account in the <processModel> section of the Machine.config
file.
- For security reasons, Microsoft recommends that you enable
impersonation on your ASP.NET application. This method works if the
impersonated user has necessary permissions to the computer and the database
that you are accessing.
- Grant read and write permissions for the "Everyone" group
on the database and the database folder. This method is not safe; therefore,
Microsoft does not recommend this method.
STATUSThis
behavior is by design.REFERENCES
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
306590
ASP.NET security overview
307626 ASP.NET configuration overview
For more information about the <processModel> section, visit the following Microsoft Developer Network (MSDN)
Web site:
Modification Type: | Minor | Last Reviewed: | 3/9/2006 |
---|
Keywords: | kbtshoot kberrmsg kbnofix kbprb kbSystemData KB316675 kbAudDeveloper |
---|
|