Name
Move (Recordset Object) —
rsObj
.Move
lngNumRecords, vntStartBookmark
Synopsis
Moves the current record pointer forward or backward a given number of records, starting at either the current record or from an optional bookmarked record.
Parameters
-
lngNumRecords The number of records from the current (or bookmarked) record that you wish to move the current record pointer. This can be a negative number to move backward in the recordset.
-
vntStartBookmark A string or variant value that represents the bookmark for a given record. In addition to a string or variant value, you can also use one of the following ADO constants for this optional parameter:
-
adBookmarkCurrent Starts at the current record. This is the default value for this parameter.
-
adBookmarkFirst Starts at the first record in the current recordset.
-
adBookmarkLast Starts at the last record in the current recordset.
-
Example
The following example demonstrates how to use the Move method to move the record pointer to a position five records after the current record.
<%@ LANGUAGE="VBSCRIPT" %> <% Response.Buffer = True %> <HTML> <HEAD> <TITLE>ADO Examples</TITLE> </HEAD> <BODY> <% ' Include ADOVBS.INC so we can use the ADO constants. %> <!-- #include virtual = "/bc_SSIncludes/adovbs.inc" --> <% ' Instantiate an ADO Connection object. Set objDBConn = Server.CreateObject("ADODB.Connection") ' Construct the connection string for the Connection object. strConn = _ "driver={MyDBType};;uid=sa;pwd=;database=SalesDB" ' Using the connection ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access