Adding a Row Using a Result Set Position
The ADO, OLE DB and ODBC application programming interfaces (APIs) support adding rows while processing the result set of a query. The fundamental process is to:
- Bind the result set columns to program variables.
- Execute the query.
- Execute API functions or methods to position the application on a row within the result set.
- Fill the bound program variables with the data values for the new row to be inserted.
- Execute one of these functions or methods to insert the row:
- In ADO, call the AddNew method of the Recordset object.
- In OLE DB, call the InsertRow method of the IRowsetChange interface.
- In ODBC 3.x, call the SQLBulkOperations function with the SQL_ADD option.
The new row is not necessarily inserted at a position based on the application’s position within the result set. The new row is inserted at a position in the base tables related to the values of any clustered key values specified.
(c) 1988-98 Microsoft Corporation. All Rights Reserved.