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 following standard bookmarks are guaranteed to be the same for all providers.

Value Description
DBBMK_INVALID DBBMK_INVALID has no special meaning in this version of OLE DB. It can be used by applications to initialize and subsequently check bookmark validity, and may be used in future releases to indicate an unused parameter in a method that may take bookmark values.
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 less than zero and lRowsOffset is zero, GetRowsAt returns this row; if cRows is less than –1, it then 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, GetRowsAt returns the last cRows rows of the rowset.

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


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