When you use ActiveX Data Objects (ADO) and set the CursorLocation property for Connection or Recordset to adUseClient, and specify asynchronous fetching with adAsyncFetch and adAsyncFetchNonBlocking for the execution options of the Execute or Open method, the client cursor engine creates a background thread to fetch data from the OLE DB Provider. With a custom provider, you may see the data fetched synchronously (the call to Execute or Open doesn't return until all of the data has been fetched).
↑ Back to the top
Because the cursor engine fetches from the provider on different threads in the asynchronous case, the provider is required to return DBPROPVAL_RT_FREETHREAD for the rowset property DBPROP_ROWTHREADMODEL.
↑ Back to the top
To allow the background fetching, a provider must return DBPROPVAL_RT_FREETHREAD for the rowset property DBPROP_ROWTHREADMODEL. This is necessary because the cursor engine is creating a secondary thread, which will continue fetching the data from the underlying rowset. The cursor engine is ensuring that apartment model rules are not being broken.
↑ Back to the top