Returns information about the data store creation properties supported by the data provider.
HRESULT GetCreationProperties ( ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets, OLECHAR **ppDescBuffer);
Parameters
If cPropertyIDSets is zero, the provider ignores rgPropertyIDSets and returns information about all of the properties in the Data Source Creation property group it supports and about all of the properties in the Initialization property group it supports for use in creating data stores.
If cPropertyIDSets is not zero, the provider returns information about the requested properties. If a property is not supported or if a property in the Initialization property group cannot be used to create data stores, the returned value of dwStatus in the returned DBPROPINFO structure for that property is DBPROPFLAGS_NOTSUPPORTED and the values of the pwszDescription, vtType, and vValues elements are undefined.
For information about the properties in the Data Source Creation and Initialization property groups that are defined by OLE DB, see "Data Source Creation Property Group," "Initialization Property Group," and "Session Property Group" in Appendix C. For information about the DBPROPIDSET structure, see "DBPROPIDSET Structure" in Chapter 14: Properties.
If cPropertyIDSets is not zero, the DBPROPINFOSET structures in *prgPropertyInfoSets are returned in the same order as the DBPROPIDSET structures in rgPropertyIDSets; that is, for corresponding elements of each array, the guidPropertySet elements are the same. If cPropertyIDs, in an element of rgPropertyIDSets, is not zero, the DBPROPINFO structures in the corresponding element of *prgPropertyInfoSets are returned in the same order as the DBPROPID values in rgPropertyIDs; that is, for corresponding elements of each array, the property IDs are the same.
The provider allocates memory for the structures and returns the address to this memory; the consumer releases this memory with IMalloc::Free when it no longer needs the structures. Before calling IMalloc::Free for *prgPropertyInfoSets, the consumer should call IMalloc::Free for the rgPropertyInfos element in each element of *prgPropertyInfoSets. If *pcPropertyInfoSets is zero on output or an error occurs, *prgPropertyInfoSets must be a null pointer on output.
For information about the DBPROPINFOSET and DBPROPINFO structures, see "DBPROPINFOSET Structure" and "DBPROPINFO Structure" in Chapter 14: Properties.
Return Code
One or more properties specified in rgPropertyIDSets were not in the Data Source Creation or Initialization property group. The dwFlags element of the DBPROPINFO structure for such properties is set to DBPROPFLAGS_NOTSUPPORTED.
One or more properties specified in rgPropertyIDSets were in the Initialization property group but could not be used to create data stores. The dwFlags element of the DBPROPINFO structure for such properties is set to DBPROPFLAGS_NOTSUPPORTED.
One or more property sets specified in rgPropertyIDSets were not supported by the provider. The dwFlags element of the DBPROPINFO structure for all specified properties in these sets is set to DBPROPFLAGS_NOTSUPPORTED. If cPropertyIDs in the DBPROPIDSET structure for the property set was zero, the provider cannot set dwStatus in the DBPROP structure because it does not know the IDs of any properties in the property set. Instead, it sets cProperties to zero in the DBPROPSET structure returned for the property set.
cPropertyIDSets was not equal to zero, and rgPropertyIDSets was a null pointer.
In an element of rgPropertyIDSets, cPropertyIDs was not zero and rgPropertyIDs was a null pointer.
Comments
IDBDataSourceAdmin::GetCreationProperties returns properties in the Data Source Creation property group as well as properties in the Initialization property group that can be used in data store creation. It is possible that there are properties in the Initialization property group that cannot be used in data store creation. The properties for which values must be set to create a data store are indicated in the dwFlags element of the DBPROPINFO structure as DBPROPFLAGS_REQUIRED.
This method can be called before the data source object has been initialized.
IDBDataSourceAdmin::CreateDataSource