Navigation:  DAO Object Classes > DaoRecordset Class >

DaoRecordset:GetRows() Method

Previous pageReturn to chapter overviewNext page

Purpose

Fetches multiple records into an array

 

Parameters

liRows(Optional) A long value that sets the number of rows to retrieve. The default is all rows

 

Returns

Two dimensional array where each row is a records and eachcolumn contains the field values

 

Remarks

The number of rows that you can retrieve is constrained by the amount of available memory. You shouldn't use GetRows to retrieve an entire table into an array if it is large.

Because GetRows returns all fields of the Recordset into the array, including Memo and Long Binary fields, you might want to use a query that restricts the fields returned.

After you call GetRows, the current record is positioned at the next unread row. That is, GetRows has the same effect on the current record as Move liRows.

 

If you are trying to retrieve all the rows by using multiple GetRows calls, use the EOF property to be sure that you're at the end of the Recordset. GetRows returns less than the number requested if it's at the end of the Recordset, or if it can't retrieve a row in the range requested. For example, if you're trying to retrieve 10 records, but you can't retrieve the fifth record, GetRows returns four records and makes the fifth record the current record. This will not generate a run-time error. This might occur if another user deletes a record in a dynaset-type Recordset.

 

Class

DaoRecordset