Solved

Lost Records in Paradox 7

Posted on 1998-06-02
5
140 Views
Last Modified: 2010-04-06
Hi there,

What is going on? I am using Delphi 3.02 and Paradox 7 tables.
I append a record to a table and post it, it seems OK. I can append records to my hearts content, filter them, look at them and all seems OK.

I then exit the program and go back in and all the records I have added have gone. I have a table with fields I use to get values for calculating primary keys and all these values have been reset to their original value.

It looks as though I am using a set of temporary tables that vanish when I exit the program.

I am not using cashed updates nor am I using transactions ( that I know of), so what is going on?

Thanks

Chris
0
Comment
Question by:ChrisBerry
[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
5 Comments
 
LVL 1

Expert Comment

by:michaue
ID: 1349854
Hi,

When I started working with Delphi I experienced the same problem.  I found that sometimes that happens when I execute my program from within Delphi (For debugging purposes or for a test run).  Some of my update and inserts just got lost.

When you run the program you have written from the EXE without having Delphi open it doesn't do that.  I suppose it is a bug somewhere in Delphi.

Try that and let me know.  If it still doesn't work feel free to discard this answer and we can look at the problem some more.
0
 

Author Comment

by:ChrisBerry
ID: 1349855
I have experienced just what you say but I would like an answer if possible. I would like to reopen the question for now to see if I can get a full answer to the problem, if I don't I will credit you later.

Thanks for the reply.
0
 
LVL 1

Accepted Solution

by:
Marcius earned 50 total points
ID: 1349856
Chris,

This is a common problem. The reason it happens is because when you post data in Paradox, it doesn't get written to disk immediately. Therefore, when you close your program, it disappears without trace.

The solution is an easy one:

In the OnPost event of your dataset, add a call to dbiSaveChanges. This is part of the dbiProcs unit and is not documented anywhere. So:

add dbiProcs to your uses statement

add dbiSaveChanges to your OnPost events.

The problem will magically disappear :)

Alternatively, you can add a procedure in your main form which will take care of all this for you.

uses dbiProcs;

procedure DoIdle(Sender: TObject; var Done: Boolean);
begin
  dbiUseIdleTime;
  Done := true;
end;

Then, add to the form create event:

  Application.OnIdle := DoIdle;

This will then use any application idle time to carry out database maintenance.

I hope this helps.
0
 
LVL 1

Expert Comment

by:michaue
ID: 1349857
Thanks, now I know too ...
0
 

Author Comment

by:ChrisBerry
ID: 1349858
Thanks, this has really been bugging me and others I know. Seem s sort of fundamental and should be documented somewhere.

Chris

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month5 days, 9 hours left to enroll

626 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