Partager via


Standard Bookmarks

Three standard bookmark values are provided: DBBMK_INVALID, DBBMK_FIRST, and DBBMK_LAST. All single-byte (length 1) bookmark values of type DBTYPE_BYTES are reserved for standard bookmarks. Ordinary bookmarks of type DBTYPE_BYTES must be at least length 2. The following constant is defined in Oledb.h as the standard bookmark length:

#define STD_BOOKMARKLENGTH 1

The values of the standard bookmarks listed in the following table are guaranteed to be the same for all providers.

Value

Meaning

DBBMK_INVALID

DBBMK_INVALID can be used by applications to initialize and subsequently check bookmark validity.

DBBMK_FIRST

The first row of the rowset.

A consumer can fetch forward from this point. For example, if cRows is greater than zero and lRowsOffset is zero, IRowsetLocate::GetRowsAt returns the first cRows rows of the rowset.

A consumer cannot fetch backward before this point. For example, if cRows is -1 and lRowsOffset is zero, IRowsetLocate::GetRowsAt returns this row. If cRows is less than ?1, it returns DB_S_ENDOFROWSET.

DBBMK_LAST

The last row of the rowset. If the rowset is being populated asynchronously, this is the last row identified so far.

A consumer can fetch backward from this point. For example, if cRows is less than zero and lRowsOffset is zero, IRowsetLocate::GetRowsAt returns the last cRows rows of the rowset.

A consumer cannot fetch forward past this point. For example, if cRows is one and lRowsOffset is zero, IRowsetLocate::GetRowsAt returns this row. If cRows is greater than one, it returns DB_S_ENDOFROWSET.

The consumer can begin a sequential scan at either the first or last row.