Exception Details: System.Data.OleDb.OleDbException: Access is denied.
Service pack informationTo resolve this problem, obtain the latest service pack for Microsoft Windows 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
- Disable impersonation for the whole ASP.NET Web application. This is the default setting.
- Disable impersonation only for the particular .aspx page that does the Index Server search. To do this, add a <location> tag to the Web.config file as follows:
<identity impersonate="false" />
To change the security context under which the ASP.NET worker process runs, set the userName attribute to SYSTEM, and then set the Password attribute to autogenerate in the <processModel> section of the Machine.config file. The Machine.config file is located in the C:\Windows Directory\Microsoft.Net\Framework\v1.0.3705\Config folder.
Microsoft has confirmed that this is a problem in Microsoft Windows 2000.
This problem was first corrected in Microsoft Windows 2000 Service Pack 4.
Steps to Reproduce the Behavior
- Start Microsoft Visual Studio .NET.
- Create an ASP.NET Web application.
- Add the following code in the HTML of an .aspx page:
<%@ Page language="c#" %>
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection("provider=msidxs;");
string Sql = "Select DocTitle, vpath, characterization, rank from Scope(' DEEP TRAVERSAL OF \"C:\\\" ') where FREETEXT(' \"ticket\" ') order by rank desc";
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(Sql, conn);
System.Data.DataSet ds = new System.Data.DataSet();
Response.Write("Search Results: <br>");
for (int i = 0; i < ds.Tables.Rows.Count; i++)
Response.Write("<br>" + ds.Tables.Rows[i]["vpath"].ToString());
- Modify the Web.config file to enable impersonation as follows:
<identity impersonate="true" />
- Make sure that the security context under which the Aspnet_wp.exe worker process runs is the ASPNET account. To do this, set the userName attribute to machine, and then set the Password attribute to autogenerate in the <processModel> section of the Machine.config file.
Note By default, the ASP.NET worker process is set to run under the security context of the restricted ASPNET account.
- Start the Indexing Service on your computer.
- Build the application, and then open the .aspx page in your browser. Notice that you receive the error message that is listed in the "Symptoms" section.
Article ID: 323293 - Last Review: Jul 14, 2008 - Revision: 1