ADODB Object
 
Syntax
 
CompareEnum = recordsetobject.CompareBookmarks (Bookmark1Bookmark2)
 
Description
Returns a CompareEnum value that compares the relative rowposition of two bookmarks in the same Recordset object.
 
The CompareBookmarks method returns one of the CompareEnum constants that allows you to compare the relative row positions of two records based upon the values of their bookmarks. Note that you are comparing bookmarks, not the values contained in the fields of the records.
 
You can only make this comparison if both records are in the same Recordset object. You cannot compare bookmarks from two different Recordset objects. However, you can compare bookmarks for records in the same Recordset that have undergone sorting or filtering.
 
Obviously, the provider must support bookmarks or you cannot use this method.
 
There are two mandatory parameters. Both are variants in type.
 
Parameter
Description
Bookmark1
The Bookmark1 is the bookmark of the first record.
Bookmark2
The Bookmark2 is the bookmark of the second record.
 
 
CompareEnum Constants 
 
Constant
Value
Description
adCompareEqual
1
Bookmarks are equal
adCompareGreaterThan
2
First bookmark is after second bookmark
adCompareLessThan
0
First bookmark is before second bookmark
adCompareNotComparable
4
Bookmarks cannot be compared
adCompareNotEqual
3
Bookmarks are not equal or in order
See Also
Example
 
If objRecordset.CompareBookmarks(Bookmark1, Bookmark2) = adCompareEqual Then
   MsgBox "Bookmarks Are Equal", vbOK
Else
   MsgBox "Bookmarks Are Not Equal", vbOK
End If