Article ID: 224332 - Last Review: August 23, 2001 - Revision: 1.0 PRB: ADO Recordset Open Method May Behave Synchronously Even if adAsyncFetch is SpecifiedThis article was previously published under Q224332 On This PageSYMPTOMS
You may see the following symptoms, even though you've specified adAsyncFetch:
CAUSE
When a recordset is opened with adAsyncFetch, only those records that are not returned during the initial fetch of records are asynchronously retrieved. If all of the records are returned in the initial fetch, no asynchronous fetching occurs, and the FetchComplete event is never raised.
RESOLUTION
If you are using a dual processor you then also need to set the "Background Fetch Size" to a low value such as 1.
STATUSThis problem was corrected in ADO 2.6. MORE INFORMATION
When you specify adAsyncFetch, 50 rows are fetched by default in the first batch of records. However, you can control the number of records in the initial fetch by setting the "Initial Fetch Size" property in the ADO Recordset Properties collection. You must set the "Initial Fetch Size" property after the ADO recordset object is created, but before the recordset is opened. Also, because asynchronous fetching requires client-size cursors, be sure to set "Initial Fetch Size" after the code to set the recordset's CursorLocation to adUseClient. Steps to Reproduce BehaviorIn the following example, the default Initial Fetch Size prevents the FetchComplete event from being raised. To work around the problem, set the Initial Fetch Size to 1, so that most records are asynchronously fetched and the FetchComplete event is raisedThis example uses the Publishers table in the Pubs sample database that comes with Microsoft SQL Server versions 6.5 and 7.0.
REFERENCES
For more information on the Initial Fetch Size property, please refer to the example provided in the following article: "What's New in ADO 2.0." (http://msdn.microsoft.com/library/techart/msdn_newado20.htm) For additional information on the adAsyncFetch flag, please refer to the Microsoft ADO Programmer's Reference, under "Open Method (ADO Recordset)." APPLIES TO
| Article Translations
|

Back to the top
