关于在连接数据库时候命名管道不工作的官方解决办法
2008-05-01 03:32
411 查看
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 <processModel> 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 <processModel> section, refer to the following MSDN documentation:
<processModel> 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
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 <processModel> 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 <processModel> section, refer to the following MSDN documentation:
<processModel> 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
相关文章推荐
- 关于数据库连接出错(错误信息:[无法加载dll(oci.dll)])的解决办法
- 关于JDBC driver连接SQL Server 2000数据库问题的解决办法
- 关于数据库查询语句SqlDataReader的连接释放问题的解决办法
- 关于PHP无法连接MSSQL数据库的解决办法
- 关于无法用127.0.0.1连接数据库的解决办法
- 关于远程连接 Windows Server 您的凭证不工作错误的解决办法
- Spring 加载数据库连接驱动的时候出现找不到驱动类解决办法。 com.mchange.v2.c3p0.DriverManagerDataSource ensureDriverLoaded
- 关于电脑未联网状态下,navicat for mysql 连接数据库不成功的解决办法
- 关于PHP无法连接MSSQL数据库的解决办法
- VSTS有Bug,分析数据库的维度和维度属性使用中文命名时候,作为报表参数会出错。虽然有解决办法但是头大。
- 关于dedecms近期频繁出现[错误警告:连接数据库失败..]错误的解决方法
- ORACLE自动断开数据库连接解决办法
- SQL SERVER 2012数据库:开启防火墙导致外部无法连接数据库解决办法
- Java连接Oracle 10g数据库抛IO异常解决办法
- win7 连接server2008远程桌面连接报错:“您的凭据不工作”的解决办法
- pl/sql developer 连接oracle 11g数据库错误代码ora12557解决办法
- Python MySQLdb连接数据库出错的解决办法
- 连接远程桌面提示: 之前用于连接到的凭据无法工作...的解决办法
- 关于ubuntu“下载软件仓库信息失败 检查您的网络连接“问题的解决办法
- 关于Win7系统下使用capDriverConnect()连接失败的解决办法