FireDAC.Comp.Client.TFDCustomCommand.Close
Delphi
procedure Close;
C++
void __fastcall Close();
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomCommand |
Description
Closes the current cursor of the command.
The Close method closes the current cursor of the command. After that, State takes the csPrepared
value.
To close all command cursors (if the command returns multiple result sets) use the CloseAll method. If there is only one single result set, then Close is equivalent to CloseAll. After the call to Close, use the NextRecordSet method to forward the command to the next accessible cursor.
The command object automatically closes all command cursors after fetching of last record from current cursor, if FetchOptions.AutoClose equals False.
Example
var
oTab: TADDatSTable;
....
ADCommand1.Prepare('select * from "Orders"');
oTab := ADCommand1.Define;
try
ADCommand1.Fetch(oTab);
finally
ADCommand1.Close;
oTab.Free;
end;