FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Major flaw in TDataBase CLASS
Posts: 74
Joined: Thu Oct 20, 2005 04:30 PM
Major flaw in TDataBase CLASS
Posted: Wed Nov 08, 2006 08:13 PM

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
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Major flaw in TDataBase CLASS
Posted: Thu Nov 09, 2006 08:21 AM

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/
Posts: 74
Joined: Thu Oct 20, 2005 04:30 PM
Major flaw in TDataBase CLASS
Posted: Thu Nov 09, 2006 12:27 PM

Hi Biel,

Its true I always used set delete on. I dont 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
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Major flaw in TDataBase CLASS
Posted: Thu Nov 09, 2006 02:18 PM
Hi Gilbert,
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
(oDbf:nArea)->(dbGoTop())


Check oDbf:nArea if is the correct data Area.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Posts: 74
Joined: Thu Oct 20, 2005 04:30 PM
Major flaw in TDataBase CLASS
Posted: Mon Nov 13, 2006 07:55 PM

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

Continue the discussion