EPUB | CHM | PDF

TDataSet.Methods.AppendRecord

Top Previous Next

Adds a new, populated record to the end of the dataset and posts it to the database.

Syntax:

procedure AppendRecord(const Values: array of const);

Description:

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

For MySQL indexed tables, the index is updated with the new record information. The newly appended 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, i.e. after the Discount field.

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