Getting Property Values

To get property values, a consumer performs the following actions:

  1. Determines the properties for which to get values.

  2. Determines the property sets that contain the identified properties.

  3. Allocates an array of DBPROPIDSET structures, one for each identified property set.

  4. Allocates an array of DBPROPIDs for each property set. The number of elements in each array is the number of properties identified in step 1 that belong to that property set.

  5. Places the ID of each property in the DBPROPID array.

  6. Places the property set GUID in the DBPROPIDSET structure for each property set. It then places the count of elements in and the pointer to the corresponding DBPROPID array in the DBPROPIDSET structure.

  7. Calls a method that gets properties and passes it the count and array of DBPROPIDSET structures.

To return property values, the provider performs the following actions:

  1. Allocates an array of DBPROPSET structures. The elements of this array correspond to the elements of the DBPROPIDSET array.

  2. For each element of the DBPROPIDSET array, allocates an array of DBPROP structures. The elements of the DBPROP array correspond to the elements of the DBPROPID array.

  3. Places the value, column ID, whether the property is required or optional, and status of each property in the DBPROP structure that corresponds to the DBPROPID value for the property.

  4. Places the property set GUID in the DBPROPSET structure for each property set. It then places the count of elements in and the pointer to the corresponding DBPROP array in the DBPROPSET structure.

  5. Returns the count and array of DBPROPSET structures to the consumer.

For example, assume that the consumer wants to get values for five properties, where properties 1, 2, and 3 are in property set A and properties 4 and 5 are in property set B. The consumer uses the following structures.

An example of how a consumer gets property values

The provider returns the following structures.

An example of what property values a provider returns

The following table lists the methods that consumers use to get property values.

Methods used by consumers to get property values

Property group Methods used to get property values
Data Source IDBProperties::GetPropertiesoledbIDBProperties__GetProperties
Data Source Information IDBProperties::GetPropertiesoledbIDBProperties__GetProperties
Index IRowsetIndex::GetIndexInfo
Initialization IDBProperties::GetPropertiesoledbIDBProperties__GetProperties
Rowset ICommandProperties::GetProperties,
IRowsetInfo::GetProperties
Session ISessionProperties::GetPropertiesoledbISessionProperties__GetProperties