<-- Previous || Up || Next -->

Bookmark From String Function
String Extras Class

Public Function BookmarkFromString( _
    ByVal vString As Variant _
    ) As Variant

Converts an 8-character-long printable string into the corresponding DAO "Bookmark" Property value.
"Bookmark" is a Recordset property within the Data Access Objects (DAO) that acts as the placeholder for a specific record.
This is the inverse of the BookmarkToString function.

Examples:
    BookmarkToString("01020304") = Chr$(1) + Chr$(2) + Chr$(3) + Chr$(4))
    BookmarkToString("010203C0") = Chr$(1) + Chr$(2) + Chr$(3) + Chr$(192))
Example:
    Assuming
       Dim wsCur As Workspace
       Set wsCur = CreateWorkspace("Main", "Admin")
       Dim dbCur As Database
       Set dbCur = wsCur.OpenDatabase("C:\TEMP\SOMEDB.MDB")
       Dim rsCur As Recordset
       Set rsCur = dbCur.OpenRecordset("MSysObjects")
       rsCur.MoveNext
       Dim strBookmark As String
       strBookmark = BookmarkToString(rsCur.Bookmark)
    for example
       rsCur.Bookmark = BookmarkFromString(strBookmark)
vBookmark: 8-character long string which represents the value of the "Bookmark" property for some DAO Recordset. Function returns Null if vBookmark is Null or cannot be fixed up to a String.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.