SelfRefreshTable

TSelfRefreshTable and SelfRefreshQuery are datasets that use BDE-Callbacks to refresh themselves if the dataset got modified by another program or by another dataset in the same application.

They use different methods for Delphi 1 and 2/3, but the source is the same for both versions.

Delphi 1:
  Paradox-tables only.

Delphi 2:
  Paradox- and dBase-tables,
  Interbase tables get the refresh-event only from other tables in the application,
  others not tested yet.

TSelfRefreshXXX should work in network-environments too. But it is only tested on Win95 with Novell 3.11, BDE ver. 3.5.

TSelfRefreshTable uses a callback to get informed about the need of a refresh. Then it uses the Application.OnIdle event to do the refresh when it is save.

Version 2.1 of this component is released to the Delphi-Super-Page.

Changes and bugfixes:

Version 2.21:
- 16-bit: Option {$K-} is possible now.
- 16-bit: If a TQuery has a master (property DataSource) and the master got changed, the TQuery get closed and opend again. This destroyed a TBDERefreshCallback, but the refresh-event belonging this TQuery was already posted to this TBDERefreshCallback. Now this refresh-event is ignored.
- If a master table refreshes, all detail-tables that are in edit-or insert-mode get posted. Now the refresh gets delayed until all detail-tables are in browse-mode or inactive.

Version 2.21:
- Prepared for Delphi 3.0.

Version 2.3:
- Can refresh SQL-Datasets even if DbiForceReread() can not.
- Prepared for working with non-BDE tables (Delphi 3.0).
- Prepared for working with External databases (Delphi >= 2).
- Interbase refresh add-on.

Version 2.31:
- Should run with Delphi 3.0 - but still not tested.
- The Datasets use the procedure CloseCursor instead of DoBeforeClose to disconnect from the Refresher. Now the Handle is still valid while disconnecting, the BDE does not nag no more if DbiRegisterCallback gets called to unregister the callback (could happen with Delphi 1).

Version 2.32:
- Bugfix: If the table to refresh was in edit-mode, the application hanged (bug since version 2.3).

Version 2.33:
- 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.

Version 2.34:
- Finalization section used instead of AddExitProc(). AddExitProc() does not work in DLL's.
- The timer in unit Refreshr can get disabled by SetRefreshCheckPeriod(0).

Also included: An Interbase refresh add-on that is currently under construction. The TSelfRefreshTable /-Query get informed by triggers about a refresh caused by another application.
If you know how to receive trigger- or "table changed" events from other database systems or ODBC-drivers, please tell me - we could make other add-on's together.

Download (24KB, Version 2.34, Last modified: Sep-30-1998)

[Back]Back to The Delphi Component Building Site

1