Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Lost Records in Paradox 7

Posted on 1998-06-02
5
Medium Priority
?
144 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
  • 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
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…
Integration Management Part 2
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

876 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