Accessing Field Values with the Default Dataset Property

From RAD Studio
Jump to: navigation, search

Go Up to Displaying, Converting, and Accessing Field Values


The most general method for accessing the value of a field is to use Variants with the FieldValues property. For example, the following statement puts the value of an edit box into the CustNo field in the Customers table:

Delphi:

Customers.FieldValues['CustNo'] := Edit2.Text;

C++:

Customers->FieldValues["CustNo"] = Edit2->Text;

Because the FieldValues property is of type Variant, it automatically converts other datatypes into a Variant value.

See Also