次の方法で共有


IRowsetIndex

IRowsetIndex is the primary interface for exposing index functionality in OLE DB. For a complete description of indexes, see Index Rowsets, and Integrated Indexes.

When to Implement

The IRowsetIndex interface is implemented by providers to expose the functionality of a file access method such as a B+-tree, or linear hash. For integrated indexes, IRowsetIndex is exposed on the base table rowset; otherwise, it is exposed on the index rowset.

A provider may also support other rowset interfaces on indexes, such as IRowsetScroll.

When to Call

The methods in IRowsetIndex are used to define a range of index entries to be read, to position at an index entry within the range, to fetch the index entry, and to access the contents of the index entry.

The following table shows how to perform various index operations.

Operation

Comments

Open an index

To get a handle to an IRowsetIndex object, the consumer calls IOpenRowset::OpenRowset, passing it the DBID of the index. The method returns a pointer to an index rowset.

Close an index

An index is closed by releasing all references to the index rowset.

Insert an index entry

New key entries are inserted into an index by using IRowsetChange.

Delete an index entry

Key entries are deleted from an index by using IRowsetChange.

Update an index entry

Key entries are updated in an index by first deleting the old index entry and then inserting a new index entry.

Traverse the index

To traverse an index, a user calls methods on IRowset. For more information, see Using Index Rowsets.

Method

Description

GetIndexInfo

Returns information about the index rowset capabilities.

Seek

Allows direct positioning at a key value within the current range.

SetRange

Restricts the set of row entries visible through calls to IRowset::GetNextRows and IRowsetIndex::Seek.

This topic is a part of: