Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Move - method of object AdoRecordset

Description:
Move the current record position in the AdoRecordset by the specified number of records.
Syntax:
Move(nRecords As Long, [vStart As Variant])
Calling:
oRs.Move nRecords
Parameters:
nRecords(Long) The number of records that the current record position moves. Greater than zero means forward and less than zero means backward.
vStart[optional] (Variant) Define the starting position (Bookmark). If not defined, the starting position will be the position of the current active record. If a valid Bookmark is defined, it will be used as starting position. It is also possible to use standard numeric constants for defining the start position:
0 (default) - (adBookmarkCurrent) Current record.
1 - (adBookmarkFirst) First record.
2 - (adBookmarkLast) Last record.
Example:
Reading the data over the PmAdo object ("/TestAdoDb"), that is already connected to the database (see DbOpen), using the SQL query ("SELECT * FROM table1"). The resulting AdoRecordset object will be stored by the PmAdo object with the defined unique identifier ("table1"), as static and readonly. It will be checked if errors occured and the method returned a valid AdoRecordset object. Then it will go through the records of the AdoRecordset object and the value of the first column of each 10th record will be written into the INFO system.
Dim oDb, oRs
Set oDb = pMe.Pm("/TestAdoDb")
Set oRs = oDb.RsOpen("table1", "SELECT * FROM table1", "cursor:static;")
  oRs.MoveFirst
  Do Until oRs.EOF
    Pm.Debug oRs.Fields(0)
    oRs.Move(10)
  Loop
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice