Solved

Lost Records in Paradox 7

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

12 Experts available now in Live!

Get 1:1 Help Now