How to fetch and update rowsets (ODBC)

To fetch and update rowsets

  1. Optionally, call SQLSetStmtAttr with an fOption of SQL_ROW_ARRAY_SIZE to change the number of rows (R) in the rowset.
  2. Call SQLFetch or SQLFetchScroll to get a rowset.
  3. If bound columns are used, use the data values and data lengths now available in the bound column buffers for the rowset.

    If unbound columns are used, for each row call SQLSetPos with Operation set to SQL_POSITION to set the cursor position; then, for each unbound column:

  4. Set up any data-at-execution text or image columns.
  5. Call SQLSetPos or SQLBulkOperations to set the cursor position, refresh, update, delete, or add row(s) within the rowset.

    If data-at-execution text or image columns are used for an update or add operation, handle them.

  6. Optionally, execute a positioned UPDATE or DELETE statement, specifying the cursor name (available from SQLGetCursorName) and using a different statement handle on the same connection.
See Also
Bookmarking Rows SQLGetCursorName
Changing Rows with Positioned Operations SQLGetData
Scrolling and Fetching Rows SQLSetStmtAttr
SQLFetchScroll  

  


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