Select the product you need help with
SQL application role errors with OLE DB resource poolingArticle ID: 229564 - View products that this article applies to. This article was previously published under Q229564 On This PageSYMPTOMS When you enable a SQL Server application role on a
Microsoft ActiveX Data Objects (ADO) connection to SQL Server, you may receive
the following error message when you connect to SQL Server 7.0:
sp_setapprole was not invoked correctly. Refer to the
documentation for more information.
[DBNETLIB][ConnectionRead (WrapperRead()).]General network error. Check your
network documentation The limitation that is described in this article also exists in the SQL Server .Net Data Provider, and in the OLE DB .Net Data Provider when used with the SQLOLEDB OLE DB Provider. When you try to set an application role on a connection that is drawn from the connection pool, you receive the following error message: General network error
CAUSE In the current design, after an application role is enabled
on a client connection to SQL Server, you cannot reset the security context of
that connection. Therefore, when the user ends the SQL Server session and
disconnects from the server, the session is not reusable. However, OLE DB
resource pooling returns the closed connection to the pool, and the error
occurs when that connection is reused and the client application tries to reset
the connection's security context by calling sp_setapprole again.
WORKAROUND The only available workaround is to disable OLE DB Resource
Pooling, which ADO uses by default. You can do this by adding "OLE DB Services
= -2" to the ADO Connection string, as shown here: Pooling can be disabled for the SQL Server .Net Data Provider by adding "Pooling=False" to the connection string. MORE INFORMATION The following code reproduces the error: REFERENCESSQL Books Online; topic: "Application Security and Application Roles"For more information about disabling OLE DB services, see the technical article "Pooling in the Microsoft Data Access Components," available on MSDN Online: http://msdn2.microsoft.com/en-us/library/ms810829.aspx For more information about how to turn off OLE DB services, see
the OLE DB Readme.txt file.
(http://msdn2.microsoft.com/en-us/library/ms810829.aspx)
PropertiesArticle ID: 229564 - Last Review: February 15, 2007 - Revision: 4.3 APPLIES TO
| Article Translations
|


Back to the top








