Skip to content

TDataLink

Data event handling agent for controls.

Declaration

Source position: db.pas line 2011

type

  TDataLink = class(TPersistent)
  public
    constructor Create;
    destructor Destroy;
    function Edit : Boolean;
    procedure UpdateRecord;
    function ExecuteAction : Boolean;
    function UpdateAction : Boolean;
    property Active: Boolean; {r}
    property ActiveRecord: Integer; {rw}
    property BOF: Boolean; {r}
    property BufferCount: Integer; {rw}
    property DataSet: TDataSet; {r}
    property DataSource: TDataSource; {rw}
    property DataSourceFixed: Boolean; {rw}
    property Editing: Boolean; {r}
    property Eof: Boolean; {r}
    property ReadOnly: Boolean; {rw}
    property RecordCount: Integer; {r}
  end;

Description

TDataLink is used by GUI controls or datasets in a master-detail relationship to handle data events coming from a TDatasource instance. It is a class that exists for component programmers, application coders should never need to use TDataLink or one of it's descendents.

DB-Aware Component coders must use a TDatalink instance to handle all communication with a TDataset instance, rather than communicating directly with the dataset. TDataLink contains methods which are called by the various events triggered by the dataset. Inversely, it has some methods to trigger actions in the dataset.

TDatalink is an abstract class; it is never used directly. Instead, a descendent class is used which overrides the various methods that are called in response to the events triggered by the dataset. Examples are .

Properties

Member Visibility Description
Active read only public Is the link active.
ActiveRecord public Currently active record.
BOF read only public Is the dataset at the first record.
BufferCount public Set to the number of record buffers this datalink needs.
DataSet read only public Dataset this datalink is connected to.
DataSource public Datasource this datalink is connected to.
DataSourceFixed public Can the datasource be changed.
Editing read only public Is the dataset in edit mode.
Eof read only public
ReadOnly public Is the link readonly.
RecordCount read only public Number of records in the buffer of the dataset.
See all Properties

Methods

Member Visibility Description
Create public Initialize a new instance of TDataLink.
Destroy public Remove an instance of TDatalink from memory.
Edit public Set the dataset in edit mode, if possible.
ExecuteAction public Execute action.
UpdateAction public Update handler for actions.
UpdateRecord public Called when the data in the dataset must be updated.
See all Methods

See also

Name Description
TDataset Base class for records-based data-access.
TDatasource Component representing the link between a local (GUI) component and a dataset.
TDetailDatalink Represents the link between a detail data source and a master datasource.
TMasterDataLink Datalink for Master-Detail relationships between datasets.