FireDAC.Comp.Client.TFDCustomCommand.AbortJob
Delphi
procedure AbortJob(AWait: Boolean = False);
C++
void __fastcall AbortJob(bool AWait = false);
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomCommand |
Description
Use the AbortJob method to abort the current command operation.
The AbortJob method aborts one of the following command operations:
- Open. The command is executing the DBMS command to open the cursor.
- Execute. The command is executing the DBMS command.
- Fetch. The command is fetching rows from the cursor.
After the call of the AbortJob method, the command state will be csPrepared
for the Open/Execute calls, and csActive
for Fetch. The AbortJob method must be called from the other thread, than from where an operation is performed.
Note: Not all DBMS APIs support the abortion of the command's execution. In this case the AbortJob method will wait until the execution is finished.
Example
ADCommand1.ResourceOptions.CmdExecMode := amAsync;
ADCommand1.Prepare('select OrderID, count(*) from "Order Details" group by OrderID');
ADCommand1.Open;
ADCommand1.AbortJob(True);