Share via


Invalid Bookmarks

A bookmark can become invalid for any of the following reasons:

  • The row it points to is deleted.

  • It is based on a primary key, and some of those key values were changed.

  • The row it points to is no longer in the rowset. This occurs only in rowsets that support DBPROP_OWNUPDATEDELETE when a row is changed in such a way that it no longer meets the search criteria of the rowset, is released, and then is refetched by IRowset::GetNextRows. For example, if the rowset contains only those rows with a job title of Assistant Manager, changing the job title in a row to Manager would remove that row from the rowset. From the point of view of that rowset, the row was deleted.

Bookmarks that have been returned by the provider are guaranteed to have predictable behavior, even if they have become invalid. If the DBPROP_BOOKMARKSKIPPED property is VARIANT_TRUE, the provider skips the bookmarked row and proceeds to the next row. If the DBPROP_BOOKMARKSKIPPED property is not VARIANT_TRUE, the provider usually returns an error. The provider must never terminate abnormally for a bookmark that it has returned to the user.

However, it is a programming error to pass a random bookmark value that has not been obtained from the provider. The effect of specifying an unknown, random bookmark value is undefined and might include abnormal termination.