I am sup****ting an older Delphi 4 application. It is a multi user
application that edits and inserts records into a dBase IV DBF residing
on a Netware server. The problem appears only once in a while, maybe
every few days for a period of a couple of hours. The applications are
all sharing this DBF, but sometimes adding a new record using the
append method of a TTable object results in an existing DBF record to
be overwritten. For example, if the DBF contains 100 records, a user
issues an action to add a record to the file, but instead of adding a
record to the end of the file, it overwrites one of the existing 100
records. The code skeleton is as follows:
ATable.Append;
ATable.FieldByName('REF').AsString:= '1234';
ATable.Post;
I inserted logging into the code to tell me which dBase record was
added, because after the ATable.Post, the record pointer should be on
the newly added record. So my code changed to:
ATable.Append;
ATable.FieldByName('REF').AsString:= '1234';
ATable.Post;
// Log the adding of the record
Logit("Added record number "+ IntToStr(ATable.Recno));
The log file will show something like:
....
Added record number 100
Added record number 101
Added record number 102
Added record number 103
Added record number 104
Added record number 88
Added record number 89
Added record number 90
.....
I have turned off all file caching in the Netware client. The Netware
client is up to date except for the W2K machines using a 2 small
revisions old due to conflicts with another legacy application. I have
tried to FlushBuffers after the post, and tried many many other things.
It appears the MDX index file is getting corrupt somehow and seeks
using the keys lead to incorrect records. I have run out of ideas, and
all my ideas are too long to list in one posting. All workstations
are running BDE 5.1 with all the same settings.
Does anyone have any ideas?


|