Corrupting Paradox Tables
I have been having a lot of problems with using paradox tables and
Delphi 2. If more than one user uses my application, some times the
index becomes out of date or the table becomes corrupt.
The problem does not seem to happen when only one user is using it at
a time.
(This post is kind'a long but I want to put all details so that
whoever that can help me will have enough information.)
Here is the set up:
- Net directory is set up correctly on the file server.
- All clients are running win95 with the BDE that came with D2.
IDAPI32.DLL 2/04/1996 02:01:48
- Every Table that corrupts has autoinc field
(Bad idea I know. I found out too late.)
- I am not doing anything unusual like calling BDE directly. Only DB
Components like, TTable, TQuery, addrecord, edit, post, etc.
This is what I have to do to fix the index out of date error.
1. The application says that the index is out of date on table
MyTable.
2. I load paradox and make sure it's the table and not some other
problem.
3. Table repair in paradox doesn't do jack.
4. I delete MyTable.px, xg0, yg0
5. I run Table repair, it usually tells me it's ok after I delete the
index files.
6. Bring the table up in Paradox and try to add a record.
Usually I find that the New record's autoinc field is smaller than the
last record. So I add couple of records so that the next record's
autoinc field will be the largest number. Then delete the records
that I created to bump the autoinc counter up.
7. Restructure the table to add the primary and secondary indexes
back.
I have also encountered situations where the table becomes completely
corrupt and nothing can open it or fix it. I have to restore from
backup.
Neither of the above problems involve the client machine locking up or
anything in that nature.
Now, my question is,
Is it the Autoinc field? Does Delphi just not support it well? It
seems like BDE is not locking the record properly since it never
happens when only one person is using the app.
I am about to put 'bdiSaveChanges' to all the afterpost events to see
if that will fix it but I would like to know if there is anything that
I am missing.
Thank you !!
J. S. Nakamura
jnaka...@kiva.net