In ODBC 2.x, the pointer to the row status array was an argument to SQLExtendedFetch. The row status array was later updated by a call to SQLSetPos. Some drivers have relied on the fact that this array does not change between SQLExtendedFetch and SQLSetPos. In ODBC 3.x, the pointer to the status array is a descriptor field and so the application can easily change it to point to a different array. This can be a problem when an ODBC 3.x application is working with an ODBC 2.x driver, but is calling SQLSetStmtAttr to set the array status pointer and is calling SQLFetchScroll to fetch data. The Driver Manager maps it as a sequence of calls to SQLExtendedFetch. In the following code, an error would normally be raised when the Driver Manager maps the second SQLSetStmtAttr call when working with an ODBC 2.x driver:
SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_STATUS_PTR, rgfRowStatus, 0);
SQLFetchScroll(hstmt, fFetchType, iRow);
SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_STATUS_PTR, rgfRowStat1, 0);
SQLSetPos(hstmt, iRow, fOption, fLock);
The error would be raised if there were no way to change the row status pointer in ODBC 2.x between calls to SQLExtendedFetch. Instead, the Driver Manager performs the following steps when working with an ODBC 2.x driver: