ADODB Object
 
Syntax
 
commandobject.Cancel
 
Description
Cancels the execution of a pending Execute call.
The Cancel method is used to cancel the last pending, asynchronous call involving the Execute method of the Command object.
 
The Options parameter of the Execute method must be set to either the adAsyncExecute or adAsyncFetch constant. Otherwise, a run-time error will be generated.
 
An asynchronous call returns control to the calling program before the operation is completed and allows the execution of the code to continue.
See Also
Execute, Connection.Cancel, Record.Cancel, Recordset.Cancel, Stream.Cancel.
Example
 
If (objCommand.State = adStateFetching) Then
   objCommand.Cancel
End If