Unit DRefresh

Classes

Functions

RefreshDataset - Version 1.

Types

Constants

Variables


Functions


function RefreshDataset(Dataset: TDataset): Boolean;

Version 1.05 Jan-24-1998 (C) 1997 Christoph R. Kirchner Made to refresh a dataset that got modified by another program or by another TDataset-component in the same application. If DbiForceReread() fails, the dataset gets refreshed by closing and opening the cursor again. This unit is donated to the public as public domain. This unit can be freely used and distributed in commercial and private environments. The author accepts no responsibility for its use or misuse. Please forward any comments or suggestions to Christoph Kirchner at: ckirchner@geocities.com Maybe you can find an update at: 'The Delphi Component Building Site' http://www.geocities.com/SiliconValley/Heights/7874/delphi.htm

legal, but incredible slow and with side-effects: function GetActiveRecord(ADataSet: TDataSet): Integer; begin with TDataLink.Create do try DataSource := TDataSource.Create(ADataSet); try DataSource.DataSet := ADataSet; BufferCount := 1000; { to set FFirstRecord to 0 - not a good idea } Result := ActiveRecord; finally DataSource.Free; DataSource := nil; end; finally Free; end; end; procedure SetActiveRecord(ADataSet: TDataSet; Value: Integer); begin with TDataLink.Create do begin DataSource := TDataSource.Create(ADataSet); DataSource.DataSet := ADataSet; ActiveRecord := Value; DataSource.Free; DataSource := nil; Free; end; end; *) (* type {$IFDEF WIN32} {$IFDEF VER90} { Delphi 2.0x: } TPublicDataSet = class(TBDEDataSet) {$ELSE DEF VER90} { Delphi >= 3.0: } TPublicDataSet = class(TDataSet) {$ENDIF DEF VER90} {$ELSE DEF WIN32} { Delphi 1.x: } TPublicDataSet = class(TDataSet) {$ENDIF DEF WIN32} public procedure DoCloseCursor; procedure DoOpenCursor; end; procedure TPublicDataSet.DoCloseCursor; begin CloseCursor; end; procedure TPublicDataSet.DoOpenCursor; begin OpenCursor; end;


Types


Constants


Variables