FireDAC.Comp.Client.TFDCustomConnection.RefCount

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDCustomConnection

Delphi

property RefCount: Integer read FRefCount;

C++

__property int RefCount = {read=FRefCount, nodefault};

Description

Returns the number of references to this connection object.

Read the RefCount property to see how many command, dataset, and transaction objects reference this connection object. The property's value may not be the exact count of objects, because some objects can reference the same connection object multiple times. 

When no more objects reference this connection object, RefCount is equal to 0.

Example

if FDConnection1.RefCount = 0 then
  FDConnection1.Close;

See Also