Sets properties in the Session property group.
HRESULT SetProperties (
ULONG cPropertySets,
DBPROPSET rgPropertySets[]);
Parameters
cPropertySets
[in]
The number of DBPROPSET structures in rgPropertySets. If this is zero, the provider ignores rgPropertySets and the method does not do anything.
rgPropertySets
[in/out]
An array of DBPROPSET structures containing properties and values to be set. The properties specified in these structures must belong to the Session property group. If the same property is specified more than once in rgPropertySets, then which value is used is provider-specific. If cPropertySets is zero, this parameter is ignored.
For information about the properties in the Session property group that are defined by OLE DB, see "Session Properties" in Appendix C. For information about the DBPROPSET and DBPROP structures, see "DBPROPSET Structure" and "DBPROP Structure" in Chapter 11.
Return Code
S_OK
The method succeeded. In all DBPROP structures passed to the method, dwStatus is set to DBPROPSTATUS_OK.
DB_S_ERRORSOCCURRED
One or more properties were not set. Properties not in error remain set. The consumer checks dwStatus in the DBPROP structures to determine which properties were not set. SetProperties can fail to set properties for a number of reasons, including:
E_FAIL
A provider-specific error occurred.
E_INVALIDARG
cPropertySets was not equal to zero and rgPropertySets was a null pointer.
In an element of rgPropertySets, cProperties was not zero and rgProperties was a null pointer.
DB_E_ERRORSOCCURRED
All property values were invalid and no properties were set. The consumer checks dwStatus in the DBPROP structures to determine why properties were not set.
See Also
IDBProperties::GetPropertyInfo, ISessionProperties::GetProperties