繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> 数据库应用 >> 关于在连接数据库时候命名管道不工作的官方解决办法

关于在连接数据库时候命名管道不工作的官方解决办法

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:27  文字大小:【】【】【
简介:MS已经确认这是一个BUG了 BUG: Named Pipes Do Not Work When Worker Process Runs Under ASPNET Account The information in this article applies to: Microsoft ASP.NET (included with the .NET Framework)...

MS已经确认这是一个BUG了

BUG: Named Pipes Do Not Work When Worker Process Runs Under ASPNET Account

The information in this article applies to:

Microsoft ASP.NET (included with the .NET Framework)

Microsoft ADO.NET (included with the .NET Framework)

This article was previously published under Q315159

SYMPTOMS

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 use the SQL Server .NET Data Provider or the OLE DB .NET Data Provider to connect to a database.

you may receive any of the following error messages:

OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.]

-or-

SqlException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.]

-or-

System.Data.SqlClient.SqlException: SQL Server does not exist or access denied

-or-

System.Data.OleDbClient.OleDbException: SQL Server does not exist or access denied

CAUSE

When the ASP.NET worker process runs under the ASPNET account, if you do not enable impersonation for an application, all the threads that run the requests for that application run under the process account. The ASPNET account cannot establish a named pipes connection to the database server.

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 section of the Machine.config file.

Enable impersonation on your ASP.NET application. This method works if the impersonated user has access to the computer and the database server that you are accessing.

Use Transmission Control Protocol/Internet Protocol (TCP/IP) instead of the named pipes protocol to connect to the database. To do this, add the following attribute to the connection string:

"Network Library =dbmssocn"

For example:

"User ID=myUserId;Password=myPassword;Initial Catalog=Pubs;Data Source=myServer;Network Library =dbmssocn"

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

REFERENCES

For additional information about ASP.NET security, click the article number below to view the article in the Microsoft Knowledge Base:

306590 INFO: ASP.NET Security Overview

For more information about the section, refer to the following MSDN documentation:

Section

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfprocessmodelsection.asp

Last Reviewed: 6/14/2002

Keywords: kbbug kbDatabase kbDSupport kbHttpRuntime kbreadme kbSecurity KB315159

责任编辑:admin
相关文章