Getting Information About Properties
To get information about properties, a consumer can perform the following actions:
Determine the properties for which to get information.
Determine the property sets that contain the identified properties.
Allocate an array of DBPROPIDSET structures, one for each identified property set.
Allocate an array of DBPROPIDs for each property set. The number of elements in the array is determined by the number of properties identified in step 1 that belong to that property set.
Store the ID of each property in the appropriate DBPROPID array.
Store the GUID for each property set in the appropriate DBPROPIDSET structure. The consumer then stores a pointer to the corresponding DBPROPID array, along with the number of elements in the array, in the same DBPROPIDSET structure.
Call a method that gets properties and pass it the count and array of DBPROPIDSET structures.
To return property values, the provider can perform the following actions:
Allocate an array of DBPROPINFOSET structures. The elements of this array correspond to the elements of the DBPROPIDSET array.
For each element of the DBPROPIDSET array, allocate an array of DBPROPINFO structures. The elements of the DBPROPINFO array correspond to the elements of the DBPROPID array.
Store the ID, description, type, property group, whether the property can be read from or written to, and list of valid values of each property in the DBPROPINFO structure that correspond to the DBPROPID value for that property. For properties that do not apply to columns, the provider sets the column ID to NULL_ID.
Store the GUID for each property set in the appropriate DBPROPINFOSET structure. The provider then stores a pointer to the corresponding DBPROPINFO array, along with the number of elements in the array, in the same DBPROPINFOSET structure.
Return the number of DBPROPINFOSET structures, along with the array of DBPROPINFOSET structures itself, to the consumer.
For example, assume that the consumer wants to get information about 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 structures shown in the following illustration.
An example of how a consumer gets information about properties
The provider returns the structures shown in the following illustration.
An example of what property information a provider returns
The following table lists methods consumers can call to get information about properties.
Property group |
Methods used to get information about properties |
---|---|
All property groups |
|
Data Source Creation |
|
Initialization |
|
Session |