Creating Virtual Primary Keys

Go to:

Application Wizard, Keys Step, Add Additional VPK…

Databases, New Virtual Primary Key...

In many cases, Iron Speed Designer cannot create certain pages that require primary keys, such as Edit Record and Show Record pages.  This occurs because the associated database tables and views used in your application do not have primary keys.  This also applies to queries created in Iron Speed Designer which do not have designated primary keys.

For database tables, database views and queries that do not have explicitly defined primary keys, you can specify ‘virtual’ primary key relationships in Iron Speed Designer, allowing you to create Edit Record and Show Record pages (and others) for these tables.  You don’t have to change your database schema in order to build full-featured applications.

Benefits

Virtual primary keys provide all of the benefits of a real primary key (explicitly declared within the database) to a database table or database view:

Virtual primary keys have several additional benefits:

Caveats

Make sure that a virtual primary key you are adding to the table or view is indeed unique. The rule of thumb is to use combination of the primary keys from the underlying tables to compose a virtual primary key for a view. Note, that often it is not possible to select a virtual primary key for a view because there is no combination of fields that is unique. For example, consider a view that has just one field – First Name – from the Customers table. This field is not unique and can not be selected as a virtual primary key.

Virtual primary keys cannot be added to physical tables that already have a physical primary key.  Tables cannot have multiple primary keys, either physical or virtual.

To create a composite virtual primary key, check the “Virtual primary key” box for each field in the composite primary key.