Link to home
Start Free TrialLog in
Avatar of Frogger
Frogger

asked on

Loosing cached DB records

I have a DB for Windows Database and I
loose records when I turn the power off to my PC, it is crutial that I loose NO records, how can I tell Delphi/BDE that I want the records written to file immediately and to take all cached files and write them to the database, turning the virtual memory off is not an option.

At the moment my code looks similar to this :

 Database1.StartTransaction;
 Table1.Insert;
 Table1.FieldByName('Age').Value := '9';
 Table1.FieldByName('Bld').Value := 'A';
 Table1.Post;
 Database1.Commit;
 Database1.ApplyUpdates([Table1]);

Your help would be greatly apprectiated!
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany 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 Motaz
Motaz

Table1.FlushBuffers;
Avatar of Frogger

ASKER

Comment accepted as answer
Avatar of Frogger

ASKER

Thanks, I figured out what the best way was to answer my question a short while after posting it, and the answer was an exact replica of your... thanks for the help anyway it's much appreciated...

Frogger :)
But I think this is suitable if you didn't use Database componet, but meilk's method is suitable for your case.

Motaz
hi frogger,

thanks for accepting my comment as answer.
glad you get it work.
good luck again

stork :-))