ExecuteComplete event (ADO)

Applies to: Access 2013, Office 2013

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


ExecuteCompleteRecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection


Parameter Description
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 EventStatusEnum. 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.


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