Page 1 of 1

DBF record Delete flag

Posted: Wed Feb 03, 2010 5:11 pm
by sfsltd
Hi all

We have been having all sorts of reliability problems with our XBase++ application. More specifically transactions failing to write reliably into DBF tables.

Some time ago we began to suspect that the delete flag function in the Alaska RDD is 'flakey' so added code that attempted to check if the delete flag was set correctly before moving on.

Recently, I noticed some code we received did not use the DELETE record flag and seemed to clear field contents instead.

Is this a known issue in the Alaska DBF drivers?

Michael

Re: DBF record Delete flag

Posted: Thu Feb 04, 2010 11:48 am
by RDalzell
We have many applications supporting databases containing over a million records using .Dbf and .Ntx without issue and use DELETED().

Re: DBF record Delete flag

Posted: Thu Feb 04, 2010 1:42 pm
by rdonnay
Michael -

Your posting triggered my memory about a problem I had when helping a customer (Bobby Drakos) with a big problem he was having after a dbGoTo(). We found that the value of the fields did not always load unless we skip off the record and back onto it again. This was causing multiple records to get added because the code read the wrong field value for that record and believed that it was at Eof() or the record was empty. I wonder if this is a similar issue with Deleted(). We made sure to always call ReloadRecord() after a dbGoTo() and the problem went away.

Code: Select all

FUNCTION ReloadRecord()

LOCAL nSaveRec := RecNo(), nSaveOrder := OrdSetFocus(0)

dbSkip()
dbSkip(-1)

IF nSaveRec # RecNo()
  dbGoTo(nSaveRec)
ENDIF

OrdSetFocus(nSaveOrder)

RETURN nil

Re: DBF record Delete flag

Posted: Thu Feb 04, 2010 3:39 pm
by sfsltd
Richard

The problem manifests itself on sequential DELETE() on many records.
In our case transactions like cancel a 'split' receipt. This transaction has a header plus one to 100's of sub-item records.
It does not happen all the time, just often enough to be highly irritating!
... so I guess it may depend on whether the application does single or multiple deletes .. and possibly how they are done.

Roger

Very helpful comment, thanks, I will try calling ReloadRecord() after a dbGoTo()... we do all sorts of things to verify transactions but that's one we haven't tried yet.

Michael