SQLSetScrollOptions Mapping
1. A call to:
KeysetSize argument
| InfoType argument
|
SQL_SCROLL_FORWARD_ONLY
| SQL_FORWARD_ONLY_CURSOR_
ATTRIBUTES2 |
SQL_SCROLL_STATIC
| SQL_STATIC_CURSOR_
ATTRIBUTES2 |
SQL_SCROLL_KEYSET_DRIVEN
| SQL_KEYSET_CURSOR_
ATTRIBUTES2 |
SQL_SCROLL_DYNAMIC
| SQL_DYNAMIC_CURSOR_
ATTRIBUTES2 |
A value greater than the RowsetSize argument
| SQL_KEYSET_CURSOR_
ATTRIBUTES2 |
The Driver Manager then verifies whether the appropriate bit is set in the *InfoValuePtr value returned by the call to SQLGetInfo, according to the value of the Concurrency argument in SQLSetScrollOptions:
Concurrency argument
| InfoType setting
|
SQL_CONCUR_READ_ONLY
| SQL_CA2_READ_ONLY_
CONCURRENCY |
SQL_CONCUR_LOCK
| SQL_CA2_LOCK_CONCURRENCY
|
SQL_CONCUR_ROWVER
| SQL_CA2_ROWVER_
CONCURRENCY |
SQL_CONCUR_VALUES
| SQL_CA2_VALUES_CONCURRENCY
|
2. A call to:
SQLSetStmtAttr (StatementHandle, SQL_ATTR_CURSOR_TYPE, ValuePtr, 0)
with *ValuePtr set to one of the following values, according to the value of the KeysetSize argument in SQLSetScrollOptions:
KeysetSize argument
| *ValuePtr
|
SQL_SCROLL_FORWARD_ONLY
| SQL_CURSOR_FORWARD_ONLY
|
SQL_SCROLL_STATIC
| SQL_CURSOR_STATIC
|
SQL_SCROLL_KEYSET_DRIVEN
| SQL_CURSOR_KEYSET_DRIVEN
|
SQL_SCROLL_DYNAMIC
| SQL_CURSOR_DYNAMIC
|
A value greater than the RowsetSize argument
| SQL_CURSOR_KEYSET_DRIVEN
|
SQLSetStmtAttr (StatementHandle, SQL_ATTR_CONCURRENCY, ValuePtr, 0)
with *ValuePtr set to the Concurrency argument in SQLSetScrollOptions.
4. If the KeysetSize argument in the call to SQLSetScrollOptions is positive, a call to:
SQLSetStmtAttr (StatementHandle, SQL_ATTR_KEYSET_SIZE, ValuePtr, 0)
with *ValuePtr set to the KeysetSize argument in SQLSetScrollOptions.
5. A call to:
SQLSetStmtAttr (StatementHandle, SQL_ROWSET_SIZE, ValuePtr, 0)
with *ValuePtr set to the RowsetSize argument in SQLSetScrollOptions.
Note When the Driver Manager maps SQLSetScrollOptions for an application working with an ODBC 3.0 driver that does not support SQLSetScrollOptions, the Driver Manager sets the SQL_ROWSET_SIZE statement option, not the SQL_ATTR_ROW_ARRAY_SIZE statement attribute, to the RowsetSize argument in SQLSetScrollOption. As a result, SQLSetScrollOptions cannot be used by an application when fetching multiple rows by a call to SQLFetch or SQLFetchScroll. It can only be used when fetching multiple rows by a call to SQLExtendedFetch.