Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bookmark a record

Status
Not open for further replies.

Albano

Instructor
Dec 11, 2000
221
0
0
PT
How can I bookmark a record.

I need to save the exact location of a record wen I finish reading the resordset, and thhen using that record later to start reding the Recordset on that location.

Note: Someting like the bookmark command on Access.

Thanks,

Albano
 
While the recordset is open use:

(where rs is the Recordset)

Dim varMyBookmark 'create a variant to hold the bookmark
(open the recordset)
varMyBookmark = rs.Bookmark 'set the bookmark at the current record
(some processing of records)
rs.Bookmark = varMyBookmark 'move the cursor back to the bookmark


Some recordsets don't support bookmarks - to check that yours does, use rs.Supports(adBookmark) - returns a boolean value.

Use can also use ADO Bookmarks to move through a recordset, ie:

rs.Move 3, adBookmarkCurrent 'moves 3 records from current

rs.Move 3, adBookmarkFirst 'moves to fourth record

rs.Move -1,adBookmarkLast 'moves to second-last record.

adBookmarkCurrent, adBookmarkFirst and adBookmarkLast are predefined in msado15.dll.

Hope this helps,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top