From 3ff285efa334cbb33005e7eff61604db1ca0201f Mon Sep 17 00:00:00 2001 From: Tomaz Zupan Date: Tue, 26 Nov 2002 20:31:52 +0000 Subject: [PATCH] 2002-11-26 21:20 UTC+0100 Tomaz Zupan --- harbour/ChangeLog | 5 +++++ harbour/contrib/odbc/browodbc.prg | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1ca7b5b9ff..f1d13753e5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-11-26 21:20 UTC+0100 Tomaz Zupan + * contrib/odbc/browodbc.prg + ! There was a bug in skipping, that threw an error when + dataset contained 0 rows + 2002-11-25 21:45 UTC-0300 Luiz Rafael Culik * utils/hbmake/hbmake.prg ! removed unused Var diff --git a/harbour/contrib/odbc/browodbc.prg b/harbour/contrib/odbc/browodbc.prg index c97ad8791b..f407609e51 100644 --- a/harbour/contrib/odbc/browodbc.prg +++ b/harbour/contrib/odbc/browodbc.prg @@ -215,20 +215,24 @@ STATIC FUNCTION Skipped( nRecs, oDataSource ) // ODBC doesn't have skip(0) ELSEIF nRecs > 0 DO WHILE nSkipped < nRecs - oDataSource:next( ) - IF oDataSource:Eof() + IF .NOT. oDataSource:Eof() + oDataSource:next( ) + IF oDataSource:Eof() oDataSource:prior( ) EXIT - ENDIF - nSkipped++ + ENDIF + nSkipped++ + ENDIF ENDDO ELSEIF nRecs < 0 DO WHILE nSkipped > nRecs - oDataSource:prior( ) - IF oDataSource:Bof() + IF .NOT. oDataSource:Bof() + oDataSource:prior( ) + IF oDataSource:Bof() EXIT - ENDIF - nSkipped-- + ENDIF + nSkipped-- + ENDIF ENDDO ENDIF ENDIF