DbxExpress Metadata in Delphi 2009
One of the really cool dbExpress features is the capability to create tables, primary keys and foreign keys through the dbx metadata classes.
The code below, create 2 tables: Country and State, add primary key in both tables and a relationship (foreign key) between the 2 tables, all using dbx metadata. Also I used BlackfishSQL as database, to use another database you just need to change the SQLConnection proprieties.
The source code is available on
Code Central: