GetRows - method of object AdoRecordset

Copies multiple records of a AdoRecordset object into an 2-dimensional array.
GetRows([nRows As Long], [vStart As Variant], [aFields As Variant]) As Array
a = oRs.GetRows(nRecords, vStart, aFields)
nRows[optional] (Long) Specifies the number of returned records. The default value is -1 = (adGetRowsRest) all remaining records.
vStart[optional] (Variant) Specifies the starting position (Bookmark). If not set, then the starting position will be the position of the current active 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 defining the start position:
0 (default) - (adBookmarkCurrent) Current record.
1 - (adBookmarkFirst) First record.
2 - (adBookmarkLast) Last record.
aFields[optional] (Variant) A single name, or an array of names or ordinal positions of the fields in the record.
Return Values:
Returns a Variant whose value is a 2-dimensional array.
Reading the data in the form of two dimensional array over the PmAdo object ("/TestAdoDb"), that is connected to the database (see DbOpen), using the SQL query ("SELECT * FROM table1"). The resulting AdoRecordset object will be stored in the PmAdo object with an unique identifier ("table1"), as (static) and (readonly). It will be checked if no error occurs and a valid AdoRecordset object was returned. The first 20 records from the current (first record) position are requested with two columns ("name", "value").
VBScriptSelect and copy to clipboard

Dim oDb, oRs, aData
Set oDb = pMe.Pm("/TestAdoDb")
Set oRs = oDb.RsOpen("table1", "SELECT * FROM table1", "cursor:static;")
If Not oRs Is Nothing Then
  aData = oRs.GetRows(20, 0, Array("name", "value"))
End If
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice