Board index » delphi » Lost records with Delphi and Paradox!

Lost records with Delphi and Paradox!

We are using Delphi 1 and Paradox tables.  We have a standard master
detail structure set up with referential integrity in place.
Inexplainably a bunch of master records have gone missing with the
detail records still there.   The user definitely entered the records
(must have to get the detail records in).  Has anyone seen this?  We
wonder if the database has been sabotaged, but even this would have
taken some effort (ie ref integrity removed first and then replaced)!

 

Re:Lost records with Delphi and Paradox!


Quote
pcw...@senet.com.au (David Candler) wrote:

I would verify that the parent records are being added by pulling up
those associated tables in the Database Desktop and running the
application.  As you add records, you should be able to see them in
the database.  It sounds like a coding problem (being a programmer, I
hate hearing that myself, but I always check that first).

If that's not it, I have seen this problem with Cached Updates
enabled.  If you are using cached updates, you might need to flush the
caches in order for the records to be written to the table.  Try using
the bdiSaveChanges and bdiIdleTime to resolve the problem.

Good luck.
D.

Quote
>We are using Delphi 1 and Paradox tables.  We have a standard master
>detail structure set up with referential integrity in place.
>Inexplainably a bunch of master records have gone missing with the
>detail records still there.   The user definitely entered the records
>(must have to get the detail records in).  Has anyone seen this?  We
>wonder if the database has been sabotaged, but even this would have
>taken some effort (ie ref integrity removed first and then replaced)!

Re:Lost records with Delphi and Paradox!


I had a similar problem in Delphi 1. The cause was not flushing the cache
to disk. Normally you don't need to but if the PC crashes or you forget to
close a table then changes are lost. The solution is to call
DbiSaveChanges(Thandle) after post/delete. Also stops index out of date
issues. I ended up inheriting the TTable down into one that does this
automatically.

Philip

David Candler <pcw...@senet.com.au> wrote in article
<32fa3a22.20994...@news.senet.com.au>...

Quote
> We are using Delphi 1 and Paradox tables.  We have a standard master
> detail structure set up with referential integrity in place.
> Inexplainably a bunch of master records have gone missing with the
> detail records still there.   The user definitely entered the records
> (must have to get the detail records in).  Has anyone seen this?  We
> wonder if the database has been sabotaged, but even this would have
> taken some effort (ie ref integrity removed first and then replaced)!

Re:Lost records with Delphi and Paradox!


Quote
David Candler wrote:

> We are using Delphi 1 and Paradox tables.  We have a standard master
> detail structure set up with referential integrity in place.
> Inexplainably a bunch of master records have gone missing with the
> detail records still there.   The user definitely entered the records
> (must have to get the detail records in).  Has anyone seen this?  We
> wonder if the database has been sabotaged, but even this would have
> taken some effort (ie ref integrity removed first and then replaced)!

1) Table's property CachedUpdates = False

2) Use this BDE API to force write to disk of buffered data :

on form's USES

uses .....,Dbiprocs,DbiTypes,Dbierrs;

procedure Table1.Afterpost(dataset:Tdataset);
begin
  DbiSaveChanges(Table1.Handle);
end;

Bye
Enrico Gherardo

Re:Lost records with Delphi and Paradox!


Quote
> We are using Delphi 1 and Paradox tables.  We have a standard master
> detail structure set up with referential integrity in place.
> Inexplainably a bunch of master records have gone missing with the
> detail records still there.   The user definitely entered the records
> (must have to get the detail records in).  Has anyone seen this?  We
> wonder if the database has been sabotaged, but even this would have
> taken some effort (ie ref integrity removed first and then replaced)!

I have, sometimes, the same problem.
But I didn't understand when and why happens.

---
Paolo di Tommaso
Via di Porta Labicana, 43
00185 Roma
Tel: +39(6)49.59.519
eMail: paol...@usa.net

I work for cheap, I drink a lot, and I don't sleep.
In other words, I'm a model programmer.

Re:Lost records with Delphi and Paradox!


Quote

> 1) Table's property CachedUpdates = False

> 2) Use this BDE API to force write to disk of buffered data :

> on form's USES

> uses .....,Dbiprocs,DbiTypes,Dbierrs;

> procedure Table1.Afterpost(dataset:Tdataset);
> begin
>   DbiSaveChanges(Table1.Handle);
> end;

I found the same problem. It's terrible.
Are you sure that how solve it.

Thanx

---
Paolo di Tommaso
Via di Porta Labicana, 43
00185 Roma
Tel: +39(6)49.59.519
eMail: paol...@usa.net

I work for cheap, I drink a lot, and I don't sleep.
In other words, I'm a model programmer.

Other Threads