IRowsetIndex

OLE DB Programmer's Reference

IRowsetIndex is the primary interface for exposing index functionality in OLE DB. For a complete description of indexes, see Chapter 10: Index Rowsets, and Chapter 11: 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" in Chapter 10: 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.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net