FetchProgress Event
Error Object
EVENT: Recordset::FetchComplete
FetchComplete
(pError, adStatus, pRecordset)
The
FetchComplete
event is fired after all of the records have been retrieved in an asynchronous fetch for a client-side
Recordset
.
An event is simply a subroutine that is automatically called 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. For example, you could notify the user that the fetch is completed, rather than making period status checks using the
FetchProgress
event.
There are three parameters passed to this event.
The
pError
parameter will be set only if an error occurred and the
adStatus
is set to
adStatusErrorsOccurred
. It is an
Error
object that describes the error.
The
adStatus
parameter is one of the
EventStatusEnum
constants that describes the current status of the 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
The
pRecordset
parameter is the
Recordset
object to which this event applies.
Code (Visual Basic):
' 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_
FetchComplete
( ByVal pError As ADODB.Error, _
adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset )
' place any code you desire here, for example
If adStatus = adStatusErrorsOccurred Then
Dim objError As ADODB.Error
For Each objError in pRecordset.Errors
Debug.Print vbTab objError.Description
Next
End If
End Sub
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information