Promotic

Move - method of the AdoRecordset object

Description:
Move the current record position in the AdoRecordset object by the specified number of records.
Syntax:
Empty Move(Long nRecords, [Variant vStart])
Parameters:
nRecords(Long) The number of records that the current record position moves.
Greater than zero means forward and negative number means backward.
vStart[optional] (Variant) Specifies the starting position (Bookmark).
If not set, then the starting position will be the position of the current record.
If a valid Bookmark is defined, then it will be used as starting position.
It is also possible to use standard numeric constants for specifying the start position:
0 (default) - (adBookmarkCurrent) Current record.
1 - (adBookmarkFirst) First record.
2 - (adBookmarkLast) Last record.
See also:
Example:
Reading the data in the PmaAdo object ("/TestAdoDb"), that is already connected to the database (see the DbOpen method), using the SQL query ("SELECT * FROM table1").
The resulting AdoRecordset object will be stored in the PmaAdo object with the defined unique identifier ("table1"), as static and readonly.
It is tested whether no error occurs 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.
JavaScriptVBScriptSelect and copy to clipboard

var oDb = pMe.Pm("/TestAdoDb");
var oRs = oDb.RsOpen("table1", "SELECT * FROM table1", "cursor:static;");
if (oRs)
{
oRs.MoveFirst();
while (! oRs.EOF)
{
Pm.Debug("Field=" + oRs.Fields.Item(0).Value);
oRs.Move(10);
}
}

History:
Pm8.01.00: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.