AnyDAC
ContentsIndexHome
PreviousUpNext
TADFetchOptions.AutoClose Property

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

Group
Links

Use AutoClose property value to control the automatic closing of a dataset cursor. 

If AutoClose is True and is fetched the last record from the current result set, then the underlying cursor will be closed, all additional not yet processed result sets will be discarded and resources associated with the cursors will be released to the DBMS. The dataset (TADDataSet descendant) itself will be not closed, but will be closed its internal command object. That allows to release cursor related DBMS resource as fast as it is possible. 

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

The default value is True.

property AutoClose: Boolean;

Mode, TADAdaptedDataSet.NextRecordSet, IADPhysCommand.NextRecordSet

What do you think about this topic? Send feedback!