Visual Basic: RDO Data Control

Cancel Method (Remote Data)

See Also    Example    Applies To

Cancels the processing of a query running in asynchronous mode, or cancels any pendingresultsagainst the specified RDO object.

Syntax

object**.Cancel**

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

The Cancel method requests that the remote data source stop work on a pending asynchronous query or cancels any pending results. In some cases, it might not be possible to cancel an operation once it is started, and in other cases it might be possible to cancel the operation, but part of its steps might have already been completed.

In situations where you need to create a result set, but do not want to wait until the query engine completes the operation, you can use the rdAsyncEnable option with the OpenResultset or Execute method. This option returns control to your application as soon as the operation is initiated, but before the first row is ready for processing. This gives you an opportunity to execute other code while the query is executed. If you need to stop this operation before it is completed, use the Cancel method against the object being created.

The Cancel method can also be used against an rdoConnection object when you use the rdAsyncEnable option to request an asynchronous connection. In this case the attempt to connect to the remote server is abandoned.

You can also use the Cancel method against a synchronous rdoResultset or rdoQuery object to flush remaining result set rows and release resources committed to the query and rdoResultset.

If you use the Cancel method against rdoResultset objects that have multiple result sets pending, all result sets are flushed. To simply cancel the current set of results and begin processing the next set, use the MoreResults method.

Note   Using the Cancel method against an executing action query might have unpredictable results. If the query is performing an operation that affects a number of rows, some of the rows might be changed, while others are not. For example, if you execute an action query containing an SQL UPDATE statement and use the Cancel method before the operation is complete, an indeterminate number of rows are updated leaving others unchanged. If you intend to use the Cancel method against this type of action query, it is recommended that you use transaction methods to rollback or commit partially completed operations.