ADO » Recordset » FetchProgress

FetchProgress (Progress, MaxProgress, adStatus, pRecordset)
The pRecordset parameter is the Recordset object to which this event applies.
The Progress parameter is a long value that tells you how many records have already been retrieved.
The MaxProgress parameter is a long value that is the maximum number of records expected to be retrieved.
The adStatus parameter is one of the EventStatusEnum constants that describes the current status of the event.

Called periodically during an asynchronous operation.Returns a long value stating how many rows have been retrieved.

The FetchProgress event is fired periodically by the provider to report on the progress of an asynchronous fetch for a client-side Recordset.

An event is simply a subroutine that can be called automatically after a specific operation has occurred. This subroutine can contain any code that you need to run when the event occurs. The subroutine will only be called if it is included in your code.

There are four parameters passed to this event.
EventStatusEnum Constants

Constant Value Description
adStatusCancel 4 Cancels the operation that fired the event
adStatusCantDeny 3 Cannot cancel pending operation
adStatusErrorsOccurred 2 Indicates that warnings and/or errors occurred
adStatusOK 1 The operation that fired the event was successful
adStatusUnwantedEvent 5 The operation that generated the event cannot generate future events


' Use the WithEvents keyword to designate that events
' can be handled by this Recordset object
Dim WithEvents objRecSet As ADODB.Recordset

' Note how the object name, objRecSet, is incorporated into the event Sub name
Private Sub objRecSet_FetchProgress( Progress As Long, _
   MaxProgress As Long, _
   adStatus As ADODB.EventStatusEnum, _
   ByVal pRecordset As ADODB.Recordset )

' place any code you desire here, for example
Print "Records retrieved = " & Progress

End Sub

See Also: