You are currently offline, waiting for your internet to reconnect

PRB: 80004005 ConnectionOpen (CreateFile()) Error Accessing SQL

This article was previously published under Q175671
SYMPTOMS
When you try to open a connection to a Microsoft SQL Server database froman Active Server Pages (ASP) page, you get the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][dbnmpntw]ConnectionOpen
(CreateFile()).

NOTE: This article assumes SQL Server is using standard security.
CAUSE
Microsoft Windows NT Server is denying access to the SQL Server. This errorcan be caused by the way Users, Groups, Rights, and Permissions areconfigured. Specifically, Microsoft Internet Information Server (IIS) doesnot have permissions to open a Named Pipe connection to the SQL Server.
RESOLUTION
If the ASP page was accessed anonymously, then the Windows NT/SQL Servercomputer needs to be able to authenticate the anonymous logon account. Todo this use one of the following methods:
  • Duplicate the anonymous account as a local account on the Windows NT/SQL Server computer with an identical name and password. To determine which account is used by IIS, open the WWW Properties dialog in the Internet Service Manager. The default account used is IUSR_<machinename>
  • Change the anonymous user on the IIS computer to be a domain account so that the Windows NT/SQL computer can verify this account against the domain controller. To change which account is used, open the WWW Properties dialog box in the Internet Service Manager. Change the Anonymous Logon Username and password. Make sure the Username refers to a domain account (for example, Northamerica\JohnSmith).
If the ASP page requires authentication and any of the following is true,the error involves a Windows NT delegation issue where the securitycredentials are lost:
  • The ASP page was accessed using Windows NT Challenge/Response, and SQL is on a different computer.
  • The SQL Server is on the same computer as IIS and the server name is specified as opposed to selecting Local.
  • The DSN has the "Trusted Connection" check box selected, and the SQL computer is set up to use Named Pipes.
To resolve this, use one of the following methods:
  • If IIS and SQL are on the same computer, select (local) instead of the server name, when you create the DSN. Also, ensure that "trusted connection" is not selected.
  • If IIS and SQL are on separate computers, ensure that TCP/IP sockets are used to access the Windows NT/SQL computer. When Named Pipes are used to access the SQL Server, IIS tries to impersonate the authenticated user, but it does not have the ability to prove its identity. By using TCP/IP sockets, the connection between SQL and IIS is not authenticated. To enable TCP/IP sockets, run the SQL Server Setup program and select TCP/IP sockets under the Change Network Support option. You may also need to run the SQL Client Configuration Utility on the IIS computer and change the Net Library from Named Pipes to TCP/IP sockets. To start the SQL Client Configuration Utility, follow these steps:
    1. Click Start, and then click Run.
    2. In the Open box, type cliconfg.exe, then click OK.
  • You can also avoid this delegation issue by choosing to authenticate via Basic (Clear Text). This will give IIS the information needed to impersonate the authenticated user to the SQL Server. Be aware that with this authentication method, passwords are transmitted across the network, and could be stolen. To change to Basic authentication, open the WWW Properties dialog box from the Internet Service Manager, and select Basic (Clear Text), and clear the Windows NT Challenge Response check box.
STATUS
This is by design.
MORE INFORMATION
When you authenticate a user with Windows NT Challenge Response, the userneeds the Access this Computer from Network right. When you authenticate auser with Basic (Clear Text), the user needs the Log on Locally right.

To set these rights:
  1. Open User Manager.
  2. Select User Rights from the Policies menu.
  3. Select which right you want to change from the drop-down menu, then select which users or groups have this right.
REFERENCES
For additional information, please see the following articles in theMicrosoft Knowledge Base:
166029 PRB: Cannot Open File Unknown Using Access

174811 FILE: Authentication and Security for Internet Developers
For the latest Knowledge Base articles and other support information onVisual InterDev and Active Server Pages, see the following page on theMicrosoft Technical Support site:
Properties

Article ID: 175671 - Last Review: 05/02/2006 13:31:42 - Revision: 5.2

Microsoft Active Server Pages 4.0, Microsoft Internet Information Server 4.0, Microsoft Internet Information Services 5.0, Microsoft Data Access Components 2.5, Microsoft Data Access Components 2.7

  • kbaspobj kbcode kbdatabase kberrmsg kbprb kbsecurity KB175671
Feedback
oFirePV = 1; var varClickTracking = 1; var varCustomerTracking = 1; var Route = "76500"; var Ctrl = ""; document.write("