A data table's primary key is a field whose value uniquely identifies each record, i.e., row, in the table. A primary key field is usually an integer field, but it can be a text, date, or decimal field. The primary key field can never contain a null value.
Every data table in your DataWeb web application must have a primary key. When you create a new data table from scratch, the default primary key field will be an automatically-incrementing integer field named RowId.
Changing a Table's Primary Key
You can change a table's primary key as long as there's no data in the table. To specify a different field for the primary key, open the table's data folder and click on the .data file and then the Design tab to display the table's schema. Click the PrimaryKey tab to display a list of possible primary key fields. Select the desired field and click the Apply button.
Importing Tables from an Access Database
When you import a table from an Access database into your web, its primary key will be preserved in the resulting data table if it meets the following criteria:
|
The primary key field must consist of a single field. Primary keys comprised of multiple fields are not supported by the DataWeb engine.
|
|
The primary key field must have a data type that corresponds to the integer, text, date, or decimal data types supported by the DataWeb engine. |