EPUB | CHM | PDF

TDataSet.Methods.InsertRecord

Top Previous Next

Inserts a new, populated record to the dataset and posts it to the database.

Syntax:

procedure InsertRecord(const Values: array of const);

Description:

Call InsertRecord to create a new, empty record at in the dataset, populate it with the field values in Values, and post the values to the database.

For PostgreSQL indexed tables, the index is updated with the new record information.

The newly inserted record becomes the active record.

Example:

This statement appends a record to the Customer table. Note that Nulls are entered for some of the values, but are not required for missing values at the end of the array argument.

Customer.InsertRecord([CustNoEdit.Text,
                       CoNameEdit.Text,
                       AddrEdit.Text,
                       Null,
                       Null,
                       Null,
                       Null,
                       Null,
                       Null,
                       DiscountEdit.Text]);