Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to determine the valid values for a dynamic pr

Author  Topic 

andypope
Starting Member

3 Posts

Posted - 2001-02-27 : 12:36:47
I'm deep in the bowels of SQL Server and trying desperately to make an asynchronous query return immediately, and I guess my specific question has become a more general one...

To allow providers to define their own product-specific properties, OLE DB supports "Dynamic Properties". For example, the OLE DB provider for SQL Server has product-specific properties such as "Asynchronous Rowset Processing", "Asynchable Abort" and "Initial Fetch Size" that control various aspects of asynchronous recordset processing. The values that these dynamic properties obviously depend on the product, and can (one would assume) be found in the product documentation. For example, the documentation states that "Asynchronous Rowset Processing" (which corresponds to OLE DB property DBPROP_ROWSET_ASYNCH) is a bitmask that can have various bits set such as DBPROPVAL_ASYNCH_INITIALIZE and DBPROPVAL_ASYNCH_BACKGROUNDPOPULATION, etc. A provider can add/remove/change these properties and their supported values at will. i.e. they're dynamic.

ADO supports dynamic properties through the Properties collection (on Connection, Command, Recordset and Field objects). You can enumerate through this collection as normal.

So different providers can provide different properties, and support different values for those properties, the definition of which (as their documentation usually states) can change from release to release and should not be relied upon (presumably because they're dynamic, right?)

My question is, how can I determine the valid values for a given dynamic property? The actual bit positions are not described in the OLE DB doco as far as I can tell. Some of the values have ADO enumerators defined, such as the "Background Thread Priority" property, which can be adPriorityAboveNormal, adPriorityLowest, etc. But the majority do not. I have the feeling the list of supported values can be found in the DBPROPINFO structure, but how the hell do I get to that from VB? Specifically, I'm trying to set "Asynchronous Rowset Processing" to DBPROPVAL_ASYNCH_INITIALIZE so I can force an Open command to return immediately (by default it waits until the rowset is initialized and the initial fetch size is filled, even if the initial fetch size is zero - this can take some time on our server, sometimes 10 seconds for a large query).

Any insight would be greatly appreciated.

Cheers,
Andy.

   

- Advertisement -