AnyDAC
ContentsIndexHome
PreviousUpNext
TADAdaptedDataSet.AbortJob Method

Use the AbortJob method to abort current dataset operation.

Group
Links
Parameters 
Description 
AWait: Boolean = False 
If True, then caller will wait until a current operation will be terminated. 

The AbortJob method aborts one of the following dataset operations:

  • Open. The dataset is executing DBMS command to open cursor.
  • ExecSQL/Execute. The dataset is executing DBMS command.
  • Fetch. The dataset is fetching rows from cursor.

After AbortJob call dataset state will be Active=False and Prepared=True for Open/ExecSQL/Execute. And Active=True for Fetch. The AbortJob method must be called from the other thread, than where a operation is performing.

procedure AbortJob(AWait: Boolean = False);
ADQuery1.ResourceOptions.CmdExecMode := amAsync;
ADQuery1.Open('select OrderID, count(*) from "Order Details" group by OrderID');
ADQuery1.AbortJob(True);
What do you think about this topic? Send feedback!