BUG: Disconnected Hierarchical Recordset Does Not Disconnect from Database Server (288409)
The information in this article applies to:
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
This article was previously published under Q288409 SYMPTOMS If you open a hierarchical ActiveX Data Objects (ADO)
recordset by using the Microsoft Data Shaping Service for OLE DB (MSDataShape)
provider, set the Recordset's ActiveConnection = Nothing to disconnect the recordset, and then close the ADO Connection
object, ADO reports that the Connection.State = 0 (adStateClosed).
However, if you then check open connections on the
database server (for example, by checking the SYSPROCESSES table on SQL Server when you use SQLOLEDB, or by checking the V$SESSION table on Oracle when you use MSDAORA), you see that the
connection to the database server remains open. CAUSE The ADO Client Cursor Engine (CCE) is not calling the
appropriate method on the MSDataShape provider to indicate that the recordset
is being disconnected and to release the reference held to the OLE DB Command
object. RESOLUTION As long as a shaped ADO Recordset object remains in the
client application (that is, as long as it has not explicitly been destroyed or
gone out of scope), the Recordset's Connection remains open on the database
server. As a developer, you must understand and address the possible
ramifications of this behavior.
As a workaround, you can persist the
Recordset to another format (to XML, to ADTG format, or to a Stream), and then
close the original Recordset to release the connection and reload the persisted
data into a new, disconnected Recordset. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
REFERENCESFor additional information, click the article number below to
view the article in the Microsoft Knowledge Base: 252482 BUG: ADO Disconnected Recordset That Uses Parameterized Query Is Not Disconnected by SQL Server
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbbug kbClient kbDatabase kbpending KB288409 |
---|
|