Major flaw in TDataBase CLASS

Major flaw in TDataBase CLASS

Postby Gilbert » Wed Nov 08, 2006 8: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
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Biel EA6DD » Thu Nov 09, 2006 8: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/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Postby Gilbert » Thu Nov 09, 2006 12:27 pm

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
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Biel EA6DD » Thu Nov 09, 2006 2:18 pm

Hi Gilbert,
Code: Select all  Expand view
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  Expand view
(oDbf:nArea)->(dbGoTop())


Check oDbf:nArea if is the correct data Area.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Postby Gilbert » Mon Nov 13, 2006 7: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
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 1 guest