How to use rowset binding (ODBC)

To use column-wise binding

  1. For each bound column
  2. Call SQLSetStmtAttr to set the following attributes:
  3. Execute the statement.
  4. Each call to SQLFetch or SQLFetchScroll retrieves R rows and transfers the data into the bound columns.

To use row-wise binding

  1. Allocate an array[R] of structures, where R is the number of rows in the rowset. The structure has one element for each column, and each element has two parts:
  2. Call SQLSetStmtAttr to set the following attributes:
  3. For each column in the result set, call SQLBindCol to point the data value and data length pointer of the column to their variables in the first element of the array of structures allocated in step 1.
  4. Execute the statement.
  5. Each call to SQLFetch or SQLFetchScroll retrieves R rows and transfers the data into the bound columns.
See Also
How to use cursors (ODBC) SQLBindCol
How Cursors Are Implemented SQLSetStmtAttr
Using Default Result Sets SQLFetchScroll

  


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