DBF record Delete flag

This forum is for general support of Xbase++
Post Reply
Message
Author
User avatar
sfsltd
Posts: 28
Joined: Sat Jan 30, 2010 7:23 am
Location: UK

DBF record Delete flag

#1 Post 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

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: DBF record Delete flag

#2 Post by RDalzell »

We have many applications supporting databases containing over a million records using .Dbf and .Ntx without issue and use DELETED().

User avatar
rdonnay
Site Admin
Posts: 4774
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DBF record Delete flag

#3 Post 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
The eXpress train is coming - and it has more cars.

User avatar
sfsltd
Posts: 28
Joined: Sat Jan 30, 2010 7:23 am
Location: UK

Re: DBF record Delete flag

#4 Post 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

Post Reply