Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Databases > Re: Weird appen...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 928 of 987
Post > Topic >>

Re: Weird append problem

by Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@[EMAIL PROTECTED] > Aug 14, 2006 at 08:18 PM

Mark M wrote:
> 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?
> 
years ago i ran into a similar problem..
  what i did was to lock the database for exclusive
access when ever i was adding/updating records.
   i would first check to see who had to lock on it
after i had locked it my self. i found that now and
then, some other user would have a lock on it and the
database would collide with no errors to the app.
  in this case, i simply attempted another lock until
i got a status back indicating that my app had the
lock on it.
   this may not apply to you but it worked for me. i don't
know how much flexibility you have with that DB engine.


-- 
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
 




 3 Posts in Topic:
Weird append problem
"Mark M" <mm  2006-08-14 15:16:01 
Re: Weird append problem
Jamie <jamie_ka1lpa_no  2006-08-14 20:18:13 
Re: Weird append problem
DB-1 <db1@[EMAIL PROTE  2006-08-15 11:58:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 12:29:12 CDT 2008.