procedure AbortJob(AWait: Boolean = False);
void __fastcall AbortJob(bool AWait = false);
Use the AbortJob method to abort the current dataset operation.
The AbortJob method aborts one of the following dataset operations:
- Open. The dataset is executing a DBMS command to open a cursor.
- ExecSQL / Execute. The dataset is executing a DBMS command.
- Fetch. The dataset is fetching rows from the cursor.
After a call to AbortJob, the
Active state of the dataset is False and
Prepared is True for Open/ExecSQL/Execute. The
Active state is True for
Fetch. The AbortJob method must be called from the other thread, than from where an operation is performed.
FDQuery1.ResourceOptions.CmdExecMode := amAsync; FDQuery1.Open('select OrderID, count(*) from "Order Details" group by OrderID'); FDQuery1.AbortJob(True);