04 RecNext - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki
RecNext method
Moves to the next record while reading data in record mode and returns True if there is a record to be read, or False if at the end of the records.
Applies to
| TableData | ArrData | RsetData | Xdata | XShared |
|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ |
When reading records in a loop, testing the return value from RecNext is the most convenient way to determine if there are no more records in order to end the loop.
For RsetData, the method skips any records which show as having been deleted by another user. These can still be reached in the recordset, but with some cursor types any attempt to access the data produces an error. RecNext skips over these records till it reaches an accessible record or the end of the recordset. If there is an error, any update is cancelled.
Record level procedures are used to process records individually in all Xdata objects. In the case of TableData, these record level procedures are buffered (100 worksheet rows at a time) which makes for very efficient sequential processing. However for random processing of datasets larger than 100 rows, this will be inefficient and it is better to use the Buffer, Value or Text properties.