The GetRows method on a Recordset object retrieves multiple records of a recordset into an array.
array = recordset.GetRows( Rows, Start, Fields )
Enumeration | Value | Description |
---|---|---|
adBookmarkCurrent | 0 | The current record. |
adBookmarkFirst | 1 | The first record. |
adBookmarkLast | 2 | The last record. |
This optional argument defaults to adBookmarkCurrent.
A two-dimensional array.
The GetRows method is used to copy records from a recordset into a two-dimensional array. The first subscript of the array identifies the field and the second array subscript identifies the record number. The array variable is automatically dimensioned to the correct size when the GetRows method returns the data.
If a value is not specified for the Rows parameter, the GetRows method automatically retrieves all the records in the Recordset object. If more records are requested than are available, GetRows returns only the number of available records.
If the Recordset object supports bookmarks, you can specify at which record the GetRows method should begin retrieving data by passing the value of that record's Bookmark property.
To restrict the fields that the GetRows method returns, you can pass either a single field name/number or an array of field names/numbers in the Fields argument.
After the GetRows method is called, the next unread record becomes the current record, or the EOF property is set to True if there are no more records.