Controlling the Creation of Instances of a Rowset or a Dataset

OLE DB Programmer's Reference

Executing an MDX query can result either in a dataset or in a flattened rowset. The application can control which object (rowset or dataset) can result from a query. The following rules determine the object resulting from ICommand::Execute when the GUID specified in the rguidDialect argument of ICommandText::SetCommandText is MDGUID_MDX.

The provider applies the following rules in the sequence shown and exits if any rule is satisfied:

  1. If the consumer has set the property DBPROP_IRowset to VARIANT_TRUE in the property set DBPROPSET_ROWSET by using ICommandProperties::SetProperties, a rowset object is created.
  2. If the consumer asks for any interface on the dataset object, a dataset object is created.
  3. If the consumer asks for any interface on the rowset object that does not exist on the dataset, a rowset object is created.

Therefore, the guaranteed way for a consumer to get the flattened rowset of a dataset is by setting the DBPROP_IRowset property to VARIANT_TRUE. The guaranteed way for a consumer to get a dataset is to set the DBPROP_IRowset property to VARIANT_FALSE (or leave it untouched) and ask for an interface on the dataset object.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net