FireDAC.Stan.Option.TFDFetchOptions.AutoClose

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AutoClose: Boolean read GetAutoClose write SetAutoClose

C++

__property bool AutoClose = {read=GetAutoClose, write=SetAutoClose, stored=IsACS, default=1};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Stan.Option.pas
FireDAC.Stan.Option.hpp
FireDAC.Stan.Option TFDFetchOptions

Description

Controls the automatic closing of a dataset cursor after fetching the last record.

Use the AutoClose property value to control the automatic closing of a dataset cursor.  If AutoClose is set to True and the last record is fetched from the current result set, then the underlying cursor is closed, all additional result sets that have not been yet processed are discarded, and the resources associated with the cursors are released. The dataset (TFDDataSet descendant) itself is closed, but its internal command object is closed. This allows the release of DBMS resources associated with a cursor as fast as possible. 

If your SQL command returns several result sets and you need to process all of them, then you must set AutoClose to False. Otherwise, after processing the first result set, all other result sets are discarded. 

The default value is True.

See Also