Link to home
Start Free TrialLog in
Avatar of i7mad
i7madFlag for Jordan

asked on

TTable AfterPost Event, BDE, Delphi 2009

Hello,

  I still use the BDE over Delphi 2009, Paradox Tables.

   if a database or a table is local on a PC installed (Paradox or Dbase) and the BDE-setting
"LOCAL SHARE" is FALSE, then changings are not stored immediatly but are kept in the memory.
This changings are gone after a crash.

  So I got an idea from a website, it says that I should write the below code to force BDE to Store changes to the table.

  in my  application which have more than 100 forms, and more than 70 tables, If I want to do this for all Tables It will take time coding.

 My Question is: is there any windows Message I can trap, so I can tell the Application to run the below code when OnPost event happens for all tables in my application.
procedure TForm1.Table1AfterPost(DataSet:TDataSet);
begin
  DbiSaveChanges(Table1.Handle);
end;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of i7mad

ASKER

Thanks Geert_Gruwez

  So I should call this procedure before Application.Terminate, or I think on Main form Destroy event?
Avatar of i7mad

ASKER

Thanks.
i7mad,
i would call it in the OnClose of the mainform
this way the applications hasn't freed all the objects yet
in the ondestroy it's possible some objects/tables got destroyed/freed allready.

G
Avatar of i7mad

ASKER

Thanks.