Skip to main content
Documentation & User Guides | Fotoware

Configuring a metadata editor for database lookup

Having set up a connection you need to make some changes to one of the text editors to make use of the database connection. In this example we will make changes to the FotoStation 4.5 Style editor that comes with FotoStation. You can change the properties of this text editor by going into the program configuration, expanding the Metadata node in the program configuration and then selecting Dialog builder. Now click on the FotoStation 4.5 Style editor and click on New to use this editor as a template for the modified editor that we will be making.

Enabling ODBC in the metadata editor

editor_odbc_setup.jpg

 

First off, we need to enable ODBC lookup in the editor. To do this, click on the Editor Properties node in the left side panel. There you will find a number of properties, one of which is Search in Database. Select the checkbox for that field so the value changes to True. (See above screenshot.) If you have more than one System DSN set up on your computer you can also choose which database you want to connect to.

If you also want to be able to write metadata entered in the text editor fields back to the database, you should also select Update database. Using this feature requires you to define a primary key; this can be done in the ODBC configuration as described above.

Enabling ODBC for your fields

editor_odbc_item_properties.jpg

 

Now you need to select the fields in the editor that should be allowed to search the database and/or write information back to it. In the example we're using for the sake of demonstration, we're applying database lookup for the Country Code and Country fields, but technically you can do the same with any other field. Simply select  the field you want to enable database lookup for (use Ctrl-Click to select several fields) and switch to the Item Properties page in the left panel and select the checkbox labeled Use as Database search field.

Naming your editor

Now you have set up a link between the database columns and metadata fields and enabled the editor to make use of the database connection. Finally, switch to the Editor Properties page and change the editor name to avoid confusion with duplicate names in the list of available editors. (Remember you cloned an existing editor.) Then click OK to store the new editor and you're done.

Using the metadata editor with database search fields

metadata_editor_usage.jpg

 

The above screenshot shows the editor where the Country and Country code fields are set up to search database fields. By typing information into the Country field and clicking on the magnifier button, you can search the database for matching information and insert any of the records found into the text editor field. A search for “An” in the Country field could for example result in the following:

db_query.jpg

If only one matching record is found in the database, that record is automatically inserted. Since Country and Country Code are part of the same record set in the database, the Country Code field in the text editor is automatically filled in when choosing a country.