|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 253604 - Last Review: February 12, 2007 - Revision: 5.1 Microsoft Access 97 database connectivity fails in Active Server PagesThis article was previously published under Q253604
When you connect to a Microsoft Access database from an Active Server Pages (ASP) page, you receive the following error message:
The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
This error occurs because both the server that is running Microsoft Internet Information Services (IIS) and the computer where the Access database is located are not correctly configured for the ASP page to connect to the Access database.
To verify that the server and the computer where the Access database is located are configured correctly, follow these steps:
- Verify the identity of the Internet Guest User account. To do this, follow these steps:
- In IIS version 4.0, Right-click the Web site in the IIS Management Console, and then click Properties.
- Click the Directory Security tab, and then click Edit in the Anonymous Access and Authentication box. The Authentication Methods dialog box appears.
- Click the Edit button next to the account that is used for anonymous access. The Anonymous User Account dialog box appears. This dialog box displays the Windows NT user identity that IIS impersonates for the Web site.
Note that the setting is set specifically for each folder or virtual directory of the Web site, and for each specific ASP page in the Web site.
If a specific ASP page is experiencing problems, verify the properties for the ASP page and for the Web site.
- If the Access database is located on a remote computer, you must take additional steps to configure the remote computer.
For additional information about how to connect to a remote Access database, click the following article number to view the article in the Microsoft Knowledge Base:
253580Â
(http://kbalertz.com/Feedback.aspx?kbNumber=253580/
)
How to connect to a remote Access database from Active Server Pages
- Set the permissions for the Access database. The database file must have at least read, write, execute, and change permissions for the Internet Guest User account. Additionally, configure the database folder to have at least read, write, execute, and change permissions.
- The Microsoft Jet database engine uses temporary files while you work with Access databases. If the temporary folders are not defined in the system variables for the computer, the Microsoft Jet database engine creates and modifies the temporary files in the WINNT\System32 folder.
The temporary folder that the Access database uses requires that access be granted to the Internet Guest User account. However, it is not a good idea to give users this type of access. We recommend that you configure both the System TEMP environment variable and the TMP environment variable as follows:-
Right-click My Computer, and then click Properties.
- Click the Environment tab, and then click an existing variable in the System section of the tab. The variable name and the value appear in the text boxes of the System Properties dialog box.
- To change the variable name, click the variable name, and then type TEMP in the Variable box.
- In the Value box, modify the text to reflect the location of the temporary folder on the computer. Typically, the path is C:\TEMP.
- Click SET. The variable is added to the System section.
- Repeat steps 4a through 4e for the TMP environment variable.
- Restart the computer.
Note You must restart your computer for these changes to take effect. The temporary folder must have at least read, write, change, and delete permissions for the Internet Guest User account.
Steps to reproduce the behavior- Change c:\path.mdb in the following code sample to the path of a valid Access database on your computer.
<HTML>
<BODY>
<%
dim cn, rs
set cn = CreateObject("ADODB.Connection")
cn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\path.mdb"
set rs = conn.execute("SELECT OrderID FROM Orders")
rs.close
set rs = nothing
cn.close
set cn = nothing
%>
</BODY>
</HTML>
- Modify the SELECT statement to a statement that is valid for the database, and then save the ASP page in a folder that is configured as part of a Web site.
- Modify the permissions for the database file, and then deny all access to the Internet Guest User account. By default, the setting is IUSR_computer_name.
- Load the ASP page in a Web browser. You receive the error message that is mentioned in the "Symptoms" section.
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
829558Â
(http://kbalertz.com/Feedback.aspx?kbNumber=829558/
)
Information about Jet 4.0 Service Pack 8
132143Â
(http://kbalertz.com/Feedback.aspx?kbNumber=132143/
)
Overview of how to help protect a Microsoft Access database
APPLIES TO- Microsoft Access 97 Standard Edition
- Microsoft Active Server Pages 4.0
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
 |
 |
 |
 |
 |
 |
 |
| |