CompareBookmarks Method (ADO)

      Applies To   

Compares two bookmarks and returns an indication of their relative values.

Syntax

result = recordset.CompareBookmarks(Bookmark1, Bookmark2) As CompareEnum

Return Value

Returns a value that indicates the relative row position of two records represented by their bookmarks. The following values can be returned.

Constant Description
adCompareLessThan The first bookmark is before the second.
adCompareEqual The bookmarks are equal.
adCompareGreaterThan The first bookmark is after the second.
adCompareNotEqual The bookmarks are not equal and not ordered.
adCompareNotComparable The bookmarks cannot be compared.

Parameters

Bookmark1   The bookmark of the first row.

Bookmark2   The bookmark of the second row.

Remarks

The bookmarks must apply to the same Recordset object, or a Recordset object and its clone. You cannot reliably compare bookmarks from different Recordset objects, even if they were created from the same source or command. Nor can you compare bookmarks for a Recordset object whose underlying provider does not support comparisons.

A bookmark uniquely identifies a row in a Recordset object. Use the current row's Bookmark property to obtain its bookmark.

An invalid or incorrectly formed bookmark will cause an error.