The ODBC driver uses a cursor to keep track of its position in the result set (the data rows that are retrieved from the database).
Each time an application calls SQLFetch(), the driver moves the cursor to the next row and returns that row. An application can also call SQLFetchScroll() or SQLExtendedFetch(), which fetches more than one row with a single call into the application buffer. This is known as "block cursor" support. Note that the actual number of rows fetched depends upon the rowset size that is specified by the application.
An application can call SQLSetPos() to position a cursor within a fetched block of data by using the SQL_POSITION option. This allows an application to refresh data in the result set. SQLSetPos() is also called to update data in the result set (by using the SQL_UPDATE option) or delete data in the result set (by using the SQL_DELETE option).
The cursor that is supported by the core ODBC functions only scrolls forward, one row at a time. To re-retrieve a row of data that was already retrieved from the result set, the application must close the cursor by calling SQLFreeStmt() with the SQL_CLOSE option, re-execute the SELECT statement, and fetch rows with SQLFetch(), SQLFetch Scroll(), or SQLExtendedFetch() until the target row is retrieved.
If you need the ability to scroll backward as well as forward, use block cursors.