Solved

Lost Records in Paradox 7

Posted on 1998-06-02
5
137 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 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

773 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