Major flaw in TDataBase CLASS

Post Reply
Gilbert
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Major flaw in TDataBase CLASS

Post by Gilbert »

Hi all,

I use a database that has 148 records in it. No indexes are used at all.

If I call oDbf:GoTop() and test the RecNo()
I get recno 14 instead of 1
If I call oDbf:GoBottom() and test the RecNo()
I get recno 142 instead of 148

Can anyone tell me why this weird result. :(

Regards
Gilbert Vaillancourt
turbolog@videotron.ca
User avatar
Biel EA6DD
Posts: 680
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca
Contact:

Post by Biel EA6DD »

Probably you are working with SET DELETE ON, and you have deleted records. So REcno 14 is the first non deleted record in your DBF.

PACK, or SET DELETE OFF.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Gilbert
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Post by Gilbert »

Hi Biel,


It`s true I always used set delete on. I don`t want to see deleted records anyway. But my database as no deleted records.

Made a second test: if i use Clipper dbGoTop() & dbGoBottom() everything works fine. Only if I use TDataBase problem returns.


Regard
Gilbert Vaillancourt
turbolog@videotron.ca
User avatar
Biel EA6DD
Posts: 680
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca
Contact:

Post by Biel EA6DD »

Hi Gilbert,

Code: Select all

METHOD GoTop()             INLINE ( ::nArea )->( DBGoTop() ),;
                                     If( ::lBuffer, ::Load(), )
METHOD GoBottom()          INLINE ( ::nArea )->( DBGoBottom() ),;
                                     If( ::lBuffer, ::Load(), )
Like can you see, the tDatabase is doing the same, (::nArea)->(dbGoTop()), (::Load() don't move the record pointer).

Try to execute

Code: Select all

(oDbf:nArea)->(dbGoTop())
Check oDbf:nArea if is the correct data Area.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Gilbert
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Post by Gilbert »

Hi Biel,

I finally found what the problem was. The database I was testing with contains special ASCII code that are in the range of 0 to 31. That was causing the problem. I did some testing with another database and everything works well.

Regards,
Gilbert Vaillancourt
turbolog@videotron.ca
Post Reply