DBPROP Structure

Consumers and providers use DBPROP structures to pass property values. An array of DBPROP structures is passed in a DBPROPSET structure.

The DBPROP structure is defined as:

typedef struct tagDBPROP {
 DBPROPID  dwPropertyID;
 DBPROPOPTIONS dwOptions;
 DBPROPSTATUS  dwStatus;
 DBID    colid;
 VARIANT   vValue;
} DBPROP;

The elements of this structure are used as described in the following table.

Elements of DBPROP structure

Element Description
dwPropertyID The ID of the property.
dwOptions The options that further describe the property. For example, when setting properties, the consumer can specify that the property is optional, and the provider should continue even if it cannot set the property value. Alternatively, consumers can specify that a property is required, in which case the provider should fail if it cannot support the property value.
dwStatus The status returned by the provider to indicate the success or failure in setting or getting the property value. This value is ignored on input.

When getting property values, and the provider returns DBPROPSTATUS_NOTSUPPORTED in this element, the values of dwOptions, colid, and vValue are undefined.

colid An optional ID for a column to which the property applies. To specify that a particular property applies to all columns, the consumer sets colid to DB_NULLID.

This is ignored unless the property can be applied to a column; that is, the DBPROPFLAGS_COLUMNOK flag is returned for the property in the dwFlags element of the DBPROPINFO structure.

vValue The value of the property.

When getting property values, if the consumer requests the value of a property that has not been set and has no default, VT_EMPTY is returned.

When setting property values, specifying VT_EMPTY returns the property to its default value.