INFO: SQL Server Spawns Additional Connections When You Open Multiple ForwardOnly ADO Recordsets (235282)
The information in this article applies to:
- Microsoft SQL Server 6.5
- Microsoft SQL Server 7.0
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.1 SP1
- ActiveX Data Objects (ADO) 2.1 SP2
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q235282 SUMMARY
When you try to open more than one ForwardOnly ADO recordset on a single Connection object at a time, only the first ADO recordset is actually opened on the Connection object. New, separate connections are created for subsequent ForwardOnly recordsets that you try to open on the Connection object.
Additional connections are opened because SQL Server can only open one ForwardOnly cursor at a time on a connection. SQL Server can only process one active statement at a time per connection.
RESOLUTION
Using any one of the following methods will allow the same connection to be used to open multiple recordsets: - Use a different cursor type, such as adOpenDynamic, adOpenKeyset, or adOpenStatic.
- Use a client side cursor instead of a server side cursor.
- Close each recordset prior to opening another on the same connection.
All three methods are commented into the sample code below. STATUS
This behavior is by design
REFERENCESFor more information on using Performance Monitor, please refer to SQL Server Books Online.
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbDatabase kbinfo KB235282 |
---|
|