ExecuteComplete Event (ADO)

The ExecuteComplete event is called after a command has finished executing.

Syntax

ExecuteComplete RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection  

Parameters

RecordsAffected
A Long value indicating the number of records affected by the command.

pError
An Error object. It describes the error that occurred if the value of adStatus is adStatusErrorsOccurred; otherwise it is not set.

adStatus
An EventStatusEnum status value. When this event is called, this parameter is set to adStatusOK if the operation that caused the event was successful, or to adStatusErrorsOccurred if the operation failed.

Before this event returns, set this parameter to adStatusUnwantedEvent to prevent subsequent notifications.

pCommand
The Command object that was executed. Contains a Command object even when calling Connection.Execute or Recordset.Open without explicitly creating a Command, in which cases the Command object is created internally by ADO.

pRecordset
A Recordset object that is the result of the executed command. This Recordset may be empty. You should never destroy this Recordset object from within this event handler. Doing so will result in an Access Violation when ADO tries to access an object that no longer exists.

pConnection
A Connection object. The connection over which the operation was executed.

Remarks

An ExecuteComplete event may occur due to the Connection.Execute, Command.Execute, Recordset.Open, Recordset.Requery, or Recordset.NextRecordset methods.

See Also

ADO Events Model Example (VC++)
ADO Event Handler Summary