Scroll out of range



Hi,

I have an ODBC datasource on a Foxpro database.
Table mTable contains more than 34000 records.
What I want is to get records after a certain number of records.
I'm trying to use SQLFetchScroll, but it always return an error with SQLState = HY106
which means "Fetch type out of range", even if I set the cursor to position 1.


Any idea what the problem could be?

Thanks.


SQLUINTEGER scrollable = SQL_SCROLLABLE;

  // Bind arrays to NOM and NAM columns.
   SQLBindCol(hstmt, 1, SQL_C_CHAR, &nom, STR_LEN, &nbTemp);
   SQLBindCol(hstmt, 2, SQL_C_CHAR, &nam, STR_LEN, &nbTemp);

// Execute a statement to retrieve rows from the table.
SQLSetStmtAttr(hstmt, SQL_ATTR_CURSOR_SCROLLABLE, &scrollable, 0);
retcode = SQLExecDirect(hstmt, "SELECT field1, field2 FROM myTable", SQL_NTS);
retcode = SQLFetchScroll(hstmt,SQL_FETCH_ABSOLUTE,1);
.