IRowsetIndex::GetIndexInfo

Returns information about the index rowset capabilities.

HRESULT GetIndexInfo (
   ULONG *                        pcKeyColumns,
   DBINDEXCOLUMNDESC **   prgIndexColumnDesc,
   ULONG *                        pcIndexProperties,
   DBPROPSET **               prgIndexProperties);

Parameters

pcKeyColumns

[out]
A pointer to memory in which to return the number of key columns in the index.

prgIndexColumnDesc

[out]
A pointer to memory in which to return an array of DBINDEXCOLUMNDESC structures in key column order. For more information, see IIndexDefinition::CreateIndex. The size of the array is equal to *pcKeyColumns. If an error occurs, *prgIndexColumnDesc is set to a null pointer.

pcIndexProperties

[out]
A pointer to memory in which to return the number of DBPROPSET structures returned in *prgIndexProperties. *pcIndexProperties is the total number of property sets for which the provider supports at least one property in the Index property group. If an error occurs, *pcIndexProperties is set to zero.

prgIndexProperties

[out]
A pointer to memory in which to return an array of DBPROPSET structures. One structure is returned for each property set that contains at least one property belonging to the Index property group. For information about the properties in the Index property group that are defined by OLE DB, see "Index Properties" in Appendix C.

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 *prgPropertySets, the consumer should call IMalloc::Free for the rgProperties element within each element of *prgPropertySets. If *pcIndexProperties is zero on output, or if an error occurs, the provider does not allocate any memory and ensures that *prgIndexProperties is a null pointer on output.

For information about the DBPROPSET and DBPROP structures, see "DBPROPSET Structure" and "DBPROP Structure" in Chapter 11.

Return Code

S_OK
The method succeeded.

E_FAIL
A provider-specific error occurred.

E_INVALIDARG
pcKeyColumns, prgIndexColumnDesc, pcIndexProperties, or prgIndexProperties was a null pointer.

E_OUTOFMEMORY
The provider was unable to allocate sufficient memory in which to return the column description structures or properties of the index.

DB_E_NOINDEX
The rowset uses integrated indexes and there is no current index.

See Also

IDBProperties::GetPropertyInfo, IIndexDefinition::CreateIndex