Skip to main content

TdxServerModeCustomDataSource.Active Property

Switches the active state of the data source.

Declaration

property Active: Boolean read; write; default False;

Property Value

Type Default
Boolean False

Remarks

Similar to the standard TDataSet.Active property, the Active property allows you to open or close the data source for data operations. A data-aware control linked to the data source can retrieve data only if the data source is active. Before making the data source active, make certain that you specified the following properties in order to avoid errors:

Setting the Active property to True does the following:

  • Fires the BeforeOpen event;

  • Connects to a database via a linked connection object. If the connection object is not specified, an error occurs;

  • Checks if the SQL adapter and target source of data (a table or a query’s SQL statement) are specified. If not, a corresponding error occurs;

  • Checks if the target data source contains the key field(s) specified in the KeyFieldNames property. If none is found, an error occurs;

  • Clears the internal cache, any associated data, and field information;

  • Retrieves the field information from the target data source;

  • Establishes a way to fetch data;

  • Fires the AfterOpen event.

Setting the Active property to False does the following:

  • Fires the BeforeClose event unless the data source is about to be destroyed;

  • Clears the internal cache, any associated data, and field information;

  • Fires the AfterClose event.

The default value of the Active property is False.

See Also