Solved

Loosing cached DB records

Posted on 2000-07-13
6
126 Views
Last Modified: 2010-04-04
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!
0
Comment
Question by:Frogger
  • 2
  • 2
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 3341170
hi frogger, i'm the stork :-))

try this change

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

meikl
0
 
LVL 7

Expert Comment

by:Motaz
ID: 3341275
Table1.FlushBuffers;
0
 

Author Comment

by:Frogger
ID: 3341293
Comment accepted as answer
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Frogger
ID: 3341294
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 :)
0
 
LVL 7

Expert Comment

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

Motaz
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 3341357
hi frogger,

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

stork :-))
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now