Cancel Method (ADO)

See Also   Example   Applies To   

Cancels execution of a pending, asynchronous Execute or Open method call.

Syntax

object.Cancel

Remarks

Use the Cancel method to terminate execution of an asynchronous Execute or Open method call (that is, the method was invoked with the adConnectAsync, adExecuteAsync, or adFetchAsync option). Cancel will return a run-time error if adRunAsync was not used in the method you're trying to terminate.

The following table shows what task is terminated when you use the Cancel method on a particular type of object.

If object is a The last asynchronous call to this method is terminated
Command Execute
Connection Execute or Open
Recordset Open