ADO WillExecute and ExecuteComplete events

Definition and Usage

The event is an automatically called subroutine after a specific operation occurs.

  • The WillExecute event is triggered before calling objcomm.Execute, objconn.Execute, or objrs.Open.
  • The ExecuteComplete event is triggered after the call to objcomm.Execute, objconn.Execute, objrs.Open, objrs.Requery, or objrs.NextRecordset is completed.

Syntax

WillExecute src,cursortyp,locktyp,options,status,objcomm,objrs,objconn
ExecuteComplete reaffected,objerror,status,objcomm,objrs,objconn
parameter Kuvaus
src a string containing the SQL command or stored procedure name.
cursortyp specifies the cursor type to be used.CursorTypeEnum one of the values.
locktyp specifies the locking type to be used.LockTypeEnum one of the values.
options one or more CommandTypeEnum or ExecuteOptionEnum Arvo
reaffected Long value, the number of records affected by the command.
objerror The Error object containing the errors that have occurred.

Note: The EventStatusEnum value must be set to adStatusErrorsOccurred to create the Error object.

status one EventStatusEnum value.
objcomm

For WillExecute: If this event is triggered by Command.Execute, the objcomm parameter will refer to the Command object, and the objrs parameter will be set to Nothing.

For ExecuteComplete: The executed Command object.

objrs

WillExecute: Jos tämä tapahtuma aiheutuu Recordset.Open:sta, objrs-parametri viittaa Recordset-objektiin, pCommand-parametri asetetaan Nothingiksi.

ExecuteComplete: Recordset-objekti, on komennon suorittamisen tulos.

objconn Käskyn suorittamisen kanssa liittyvä Connection-objekti.

EventStatusEnum-arvot

Vakiot Arvo Kuvaus
adStatusOK 1 Tapahtuman aiheuttanut operaatio onnistui.
adStatusErrorsOccurred 2 Tapahtuman aiheuttanut operaatio epäonnistui.
adStatusCantDeny 3 Ei voida perua keskeytetyttä operaatiota.
adStatusCancel 4 Peruuta operaatio, joka aiheutti tapahtuman.
adStatusUnwantedEvent 5 Estä seuraavat ilmoitukset ennen tapahtuman suorittamista.