FireDAC.Comp.Client.TFDCustomCommand.Close

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDCustomCommand

Delphi

procedure Close;

C++

void __fastcall Close();

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;

See Also