Sets or returns a bookmark that uniquely identifies the current record in a CdbRecordset object.
Syntax
CdbBookmarkGetBookmark(VOID);
VOIDSetBookmark(class CdbBookmark );
Parameters
Type | Description |
Class CdbBookmark | A bookmark of the desired record position. |
Remarks
For a CdbRecordset object based entirely on Microsoft Jet tables, the value of the Bookmarkable property is True, and you can use the Bookmark property with that Recordset. Other database products may not support bookmarks, however. For example, you can't use bookmarks in any Recordset object based on a linked Paradox table that has no primary key.
When you create or open a CdbRecordset object, each of its records already has a unique bookmark. You can save the bookmark for the current record by assigning the value of the Bookmark property to a variable. To quickly return to that record at any time after moving to a different record, set the CdbRecordset object's Bookmark property to the value of that variable.
There is no limit to the number of bookmarks you can establish. To create a bookmark for a record other than the current record, move to the desired record and assign the value of the Bookmark property to a String variable that identifies the record.
To make sure the CdbRecordset object supports bookmarks, check the value of its Bookmarkable property before you use the Bookmark property. If the Bookmarkable property is False, the CdbRecordset object doesn't support bookmarks, and using the Bookmark property results in a trappable error.
If you use the Clone method to create a copy of a CdbRecordset object, the Bookmark property settings for the original and the duplicate CdbRecordset objects are identical and can be used interchangeably. However, you can't use bookmarks from different CdbRecordset objects interchangeably, even if they were created by using the same object or the same SQL statement.
If you set the Bookmark property to a value that represents a deleted record, a trappable error occurs.
The value of the Bookmark property isn't the same as a record number.