EndOfRecordset Event (ADO)
The EndOfRecordset event is called when there is an attempt to move to a row past the end of the Recordset.
EndOfRecordset fMoreData, adStatus, pRecordset
A VARIANT_BOOL value that, if set to VARIANT_TRUE, indicates more rows have been added to the Recordset.
An EventStatusEnum status value.
When EndOfRecordset is called, this parameter is set to adStatusOK if the operation that caused the event was successful. It is set to adStatusCantDeny if this event cannot request cancellation of the operation that caused this event.
Before EndOfRecordset returns, set this parameter to adStatusUnwantedEvent to prevent subsequent notifications.
A Recordset object. The Recordset for which this event occurred.
An EndOfRecordset event may occur if the MoveNext operation fails.
This event handler is called when an attempt is made to move past the end of the Recordset object, perhaps as a result of calling MoveNext. However, while in this event, you could retrieve more records from a database and append them to the end of the Recordset. In that case, set fMoreData to VARIANT_TRUE, and return from EndOfRecordset. Then call MoveNext again to access the newly retrieved records.