How Cursors Are Implemented

ODBC applications control the behavior of a cursor by setting one or more statement attributes before executing an SQL statement. ODBC has two different ways to specify the characteristics of a cursor:

The characteristics of an ODBC cursor should be specified using either one or the other of these two methods, with the preference being to use the ODBC cursor types. While you can set all three options for the same cursor, the Microsoft ODBC 3.0 Programmer’s Reference warns that this can prevent an ODBC driver from being able to efficiently implement the cursor.

In addition to setting the type of a cursor, ODBC applications also set other options, such as the number of rows returned on each fetch, concurrency options, and transaction isolation levels. These options can be set for either ODBC-style cursors (forward-only, static, keyset-driven, mixed, and dynamic) or SQL-92/ISO style cursors (scrollability and sensitivity).

The Microsoft® SQL Server™ ODBC driver supports several ways to physically implement the various types of cursors. The driver implements some types of cursors using a SQL Server default result set; it implements others as server cursors or by using the ODBC Cursor Library.

To use cursors

See Also
SQLSetStmtAttr  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.