--- sql/odbc/parser3odbc.C 2004/09/13 14:47:43 1.26 +++ sql/odbc/parser3odbc.C 2008/06/30 10:13:04 1.26.2.1 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char *RCSId="$Id: parser3odbc.C,v 1.26 2004/09/13 14:47:43 paf Exp $"; +static const char *RCSId="$Id: parser3odbc.C,v 1.26.2.1 2008/06/30 10:13:04 misha Exp $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] @@ -209,11 +209,10 @@ public: CRecordset rs(db); TRY { rs.Open( - CRecordset::forwardOnly - ||CRecordset::readOnly, + CRecordset::forwardOnly, statement, - CRecordset::executeDirect - ); + CRecordset::executeDirect|CRecordset::readOnly + ); } CATCH_ALL (e) { // could not fetch a table TRY { @@ -261,19 +260,27 @@ public: } CHECK(handlers.before_rows(sql_error)); + + // skip offset rows + if(offset){ + unsigned long row=offset; + while(!rs.IsEOF() && row>0){ + rs.MoveNext(); + row--; + } + } unsigned long row=0; CDBVariant v; CString s; - while(!rs.IsEOF() && (!limit||(row=offset) { - CHECK(handlers.add_row(sql_error)); - for(int i=0; i