Creating Cursors

For the purposes of ODBC cursors, the cursor definition is essentially the SQL statement passed as an argument to SQLExecuteDirect or SQLPrepare/SQLExecute. The following rules apply when creating cursors through the SQL Server driver:

Keyset cursors could also be populated asynchronously (please refer to the SQL Server documentation about sp_configure). Asynchronous keyset population does not affect the cursor-related ODBC APIs except for SQLRowCount.

The following ODBC functions are relevant for creating cursors:

SQLSetStmtOption SQLGetCursorName
SQLSetScrollOptions SQLGetStmtOption
SQLSetConnectOption SQLGetInfo
SQLSetCursorName