Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

AddNew Method

See Also
Example
Applies To

OraDynaset

Description

Clears the copy buffer and begins a record insertion operation into the specified dynaset and associated database.

Usage

oradynaset.AddNew

oradynaset.DbAddNew

Remarks

Upon initiation of a AddNew operation, values of fields present within the dynaset are maintained in a copy buffer and do not yet reflect the actual contents of the database.

The values of the fields are modified through the OraField object, and committed with Update or when database movement occurs, which discards the new row. Field values that have not been explicitly assigned are either set to NULL or allowed to default by way of the Oracle default mechanism, depending on the Column Defaulting mode of the options flag used when the OpenDatabase method was called. In either case, fields that appear in the database table but not in the dynaset are always defaulted by the Oracle default mechanism.

Internally, records are inserted by AddNew using the "INSERT into TABLE (...) VALUES (...)" SQL statement, and are therefore added to the end of the table.

When adding a row having object, collection, and REF columns, the column value of the object, collection, and REF type should be set to a valid OraObject, OraCollection, or OraRef interface or the Null value. The column values can also be set with the automation object returned by the CreateOraObject method. When adding a row having a BLOB, CLOB, or BFile column, the column value should be set to a valid OraBlob, OraClob, or OraBFile interface, Null, or Empty. Setting a BLOB, CLOB, and BFile column to an Empty value inserts an empty LOB value into the database.

Note: A call to Edit, AddNew, or Delete, will cancel any outstanding Edit or AddNew calls before proceeding. Any outstanding changes not saved using Update will be lost during the cancellation.