Solved

Loosing cached DB records

Posted on 2000-07-13
6
127 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 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

18 Experts available now in Live!

Get 1:1 Help Now