Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Extended EDBDatabase with cleanup
Sun, Sep 20 2020 10:35 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Just in case anyone else wants it I've subclassed EDBDatabase

{$IFDEF D15UP}
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
{$ENDIF}
TnlhDatabase = class(TEDBDatabase)
public
 procedure Rollback(DoCleanup: boolean = False); overload;
published
 property Connected stored False;
end;


procedure TnlhDatabase.Rollback(DoCleanup: boolean = False);
var
Cntr: integer;
begin
if DoCleanup then begin
 for Cntr := 0 to DataSetCount - 1 do begin
  if TableInTransaction(DataSets[Cntr].Name) then begin
   if DataSets[Cntr].State in dsEditModes then DataSets[Cntr].Cancel;
   DataSets[Cntr].Refresh;
  end;
 end;
end;
inherited Rollback;
end;


Roy Lambert
Image