A database field consists of the following components:
- An optional reference to an existing Microsoft Data Link file (udl)
- A connection string
- The name of the table or query containing the selected field
- The name of the selected field
- The key access type: a primary key (1) or a row index (2)
- The SQL Select clause to retrieve the field from the specified record in the specified table or query
- Optional formatting options, depending upon the data type of the selected field
The field expression for a database field could look like this:
%<AecDb "DatabaseField" "C:DataRialto DocsDatabaseExample04 Areas Flattened.udl" "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=04 Areas Flattened.mdb;Persist Security Info=False" "AEC__Object Types" "ObjectTypeId" "1" "SELECT [ObjectTypeId] FROM [AEC__Object Types] WHERE [ObjectTypeId] = 3">%
If the user has selected a table with a primary key, then the field code retrieves the selected field value using the primary key value. If the user has selected a table without a primary key, then the field code retrieves the selected value using the row index. If the user has selected a query, then the field code retrieves the selected value using the row index.