DBPROPOPTIONS Enumerated Type

Consumers use DBPROPOPTIONS values to specify whether a property value is required or optional. The values of DBPROPOPTIONS are mutually exclusive. DBPROPOPTIONS is used in the DBPROP structure.

The values of DBPROPOPTIONS have the following meanings.

DBPROPOPTIONS values

Value Description
DBPROPOPTIONS_
REQUIRED
The specified property value is required.

If the provider does not support the specified property, it sets the dwStatus element of the DBPROP structure to DBPROPSTATUS_NOTSUPPORTED and returns DB_E_ERRORSOCCURRED. Whatever action the method was to take, such as initializing a data source or creating a rowset, fails.

If the provider supports the specified property, then all methods except IcommandProperties::SetProperties can determine whether the specified value is supported. If the provider does not support the specified value, it sets dwStatus to DBPROPSTATUS_NOTSUPPORTED and returns DB_E_ERRORSOCCURRED. Whatever action the method was to take, such as initializing a data source or creating a rowset, fails.

If SetProperties can determine that the provider cannot support the specified value, it sets dwStatus to DBPROPSTATUS_NOTSUPPORTED and returns DB_S_ERRORSOCCURRED. If SetProperties cannot determine whether the provider can support the specified value, it sets dwStatus to DBPROPSTATUS_OK. When ICommand::Execute is called, the provider determines whether it can support the specified value. If the provider cannot support the specified value, Execute returns DB_E_ERRORSOCCURRED.
DBPROPOPTIONS_
OPTIONAL
The provider should set the property to the requested value only if it can.

If the provider does not support the specified property, it sets the dwStatus element of the DBPROP structure to DBPROPSTATUS_NOTSUPPORTED and returns DB_S_ERRORSOCCURRED. Whatever action the method was to take, such as initializing a data source or creating a rowset, succeeds.

If the provider supports the specified property, then all methods except SetProperties can determine whether the specified value can be supported. If the provider cannot support the specified value, it sets dwStatus to DBPROPSTATUS_NOTSET and returns DB_S_ERRORSOCCURRED. Whatever action the method was to take, such as initializing a data source or creating a rowset, succeeds.

If SetProperties can determine that the provider can support the specified value, it sets dwStatus to DBPROPSTATUS_OK. ICommandProperties::GetProperties returns the specified value in the vValue element of the DBPROP structure and DBPROPOPTIONS_REQUIRED in the dwOptions element of the DBPROP structure. If SetProperties can determine that the provider cannot support the specified value, it sets dwStatus to DBPROPSTATUS_NOTSET and returns DB_S_ERRORSOCCURRED. GetProperties returns the specified value vValue and DBPROPOPTIONS_REQUIRED in dwOptions.

If SetProperties cannot determine whether the provider can support the specified value, it sets dwStatus to DBPROPSTATUS_OK. GetProperties returns the specified value in vValue and DBPROPOPTIONS_OPTIONAL in dwOptions. When Execute is called, the provider determines whether it can support the specified value. If the provider cannot support the specified value, Execute returns DB_S_ERRORSOCCURRED, but successfully executes the command.