[in] A pointer to the DBID of the table for which to create an index.
[in] A pointer to the ID of the new index to create. If this is a null pointer, the provider assigns an ID to the index. The ID must be unique.
[in] The count of DBINDEXCOLUMNSDESC structures in rgIndexColumnDescs.
[in] An array of DBINDEXCOLUMNDESC structures that describe how to construct the index. The order of the DBINDEXCOLUMNDESC structures in rgIndexColumnDescs determines the order of the columns in the index key. That is, the column identified by the first element of this array is the most significant column in the index key and the column identified by the last element is the least significant column. When the index is opened as a rowset, the key columns occur in order of most significant column to least significant column.
The elements of this structure are used as follows.
A pointer to the ID of the base table column.
Whether the index is ascending or descending in this column.
DBINDEX_COL_ORDER_ASC — Ascending
DBINDEX_COL_ORDER_DESC — Descending
[in] The number of DBPROPSET structures in rgPropertySets. If this is zero, the provider ignores 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 Index property group. If the same property is specified more than once in rgPropertySets, it is provider-specific which value is used. If cPropertySets is zero, this argument is ignored.
[out] A pointer to memory in which to return a pointer to the DBID of a newly created index. If ppIndexID is a null pointer, no DBID is returned.
The contents of *ppIndexID might not exactly match the passed *pIndexID. The consumer should use *ppIndexID to identify the newly created index. If ppIndexID is NULL on input and the provider cannot create an index that exactly matches *pIndexID, IIndexDefinition::CreateIndex should fail with DB_E_BADINDEXID.
The method succeeded, and the new index has been created. In all DBPROP structures passed to the method, dwStatus is set to DBPROPSTATUS_OK.
The index was created, but one or more properties — for which the dwOptions element of the DBPROP structure was DBPROPOPTIONS_OPTIONAL — were not set. The consumer checks dwStatus in the DBPROP structures to determine which properties were not set. The method can fail to set properties for a number of reasons, including the following:
The property was not supported by the provider.
The property was not in the Index property group.
The property set was not supported by the provider.
It was not possible to set the property.
The colid in the DBPROP structure was not DB_NULLID.
The data type in vValue in the DBPROP structure was not the data type of the property or was not VT_EMPTY.
The value in vValue in the DBPROP structure was invalid.
The property's value conflicted with an existing property.
The specified table was in use, and the provider could not create the index with the table open.
A provider-specific error occurred.
pTableID was a null pointer.
pIndexID and ppIndexID were both null pointers.
cIndexColumnDescs was zero.
rgIndexColumnDescs was a null pointer.
eIndexColOrder in an element of rgIndexColumnDescs was not a valid value.
cPropertySets was not zero, and rgPropertySets was a null pointer.
In an element of rgPropertySets, cProperties was not zero and rgProperties was a null pointer.
*pIndexID was an invalid index ID.
The specified index already exists in the data store.
No index was created because one or more properties — for which the dwOptions element of the DBPROP structure was DBPROPOPTIONS_REQUIRED or an invalid value — were not set. The consumer checks dwStatus in the DBPROP structures to determine which properties were not set. None of the satisfiable properties are remembered. The method can fail to set properties for any of the reasons specified in DB_S_ERRORSOCCURRED.
A column specified by *pColumnIDin an element of rgIndexColumnDescs does not exist in the specified table.
The specified table does not exist in the data store.
The consumer did not have sufficient permission to create the index.