Class TSelfRefreshQuery (unit RefreshQ)

Inherits from

TQuery

Version 2.33 Aug-23-1997 (C) 1997 Christoph R. Kirchner TSelfRefreshQuery is a TQuery-descendant that uses BDE-Callbacks to refresh itself if the dataset got modified by another program or by another TDataset-component in the same application. Delphi 1: Queries on Paradox tables only. Delphi >= 2.0: Queries on Paradox and dBase tables, queries on Interbase tables get the refresh-event only inside the application, others not tested yet. Please Note that querys cannot get refreshed if RequestLive is false. The author assumes no liability for damages and disclaims all warranties. See disclaimer in Readme.txt. Please forward any comments or suggestions to Christoph Kirchner at: ckirchner@geocities.com

Constructors


constructor Create(AOwner: TComponent);

TSelfRefreshQuery ---------------------------------------------------------


Functions

destructor Destroy;

Delphi 2.

procedure DoRefresh(Dataset: TDataset; var Done: Boolean);


procedure CloseCursor;


procedure DisableRefresh;

and RequestLive

procedure DoAfterOpen;


procedure DoAfterRefresh;


procedure DoBeforeRefresh;


procedure EnableRefresh;


function RefreshCallBack(CBInfo: Pointer): CBRType;

Delphi 2.

procedure SetSelfRefreshEnabled(Value: Boolean);


Properties

property AfterRefresh : TDataSetNotifyEvent


property BeforeRefresh : TDataSetNotifyEvent


property SelfRefreshEnabled : Boolean


Events

Variables

FAfterRefresh : TDataSetNotifyEvent;


FBeforeRefresh : TDataSetNotifyEvent;


FCSDesigningAndOwnerIsDataModule : Boolean;

Delphi 2.

FSelfRefreshEnabled : Boolean;



Constructors


constructor Create(AOwner: TComponent);

TSelfRefreshQuery ---------------------------------------------------------


Functions


destructor Destroy;

Delphi 2.0 bug workaround:


procedure DoRefresh(Dataset: TDataset; var Done: Boolean);


procedure CloseCursor;


procedure DisableRefresh;

and RequestLive


procedure DoAfterOpen;


procedure DoAfterRefresh;


procedure DoBeforeRefresh;


procedure EnableRefresh;


function RefreshCallBack(CBInfo: Pointer): CBRType;

Delphi 2.0 bug workaround:


procedure SetSelfRefreshEnabled(Value: Boolean);


Properties


property AfterRefresh : TDataSetNotifyEvent


property BeforeRefresh : TDataSetNotifyEvent


property SelfRefreshEnabled : Boolean


Events


Variables


FAfterRefresh : TDataSetNotifyEvent;


FBeforeRefresh : TDataSetNotifyEvent;


FCSDesigningAndOwnerIsDataModule : Boolean;

Delphi 2.0 bug workaround: If Delphi 2 is closing, the ComponentState-flag csDesigning gets removed from the Datasets before they get destroyed - but only if the Owner is a TDataModule. We don't want to call DisableRefresh in this case:


FSelfRefreshEnabled : Boolean;