Solved

Loosing cached DB records

Posted on 2000-07-13
6
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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