Database Setup Dialog

The Database Setup dialog is used to set up one or more databases to be read from at print time. BarTender will read records from the databases and source the data into the appropriately configured objects on the template.

ClosedTo open the Database Setup dialog

You can open the Database Setup dialog using one of the following methods:

If you have not previously connected to a database, the methods listed above will launch the Database Setup Wizard. Complete the wizard to display the Database Setup dialog.

All connected databases appear in the left Navigation Pane of the Database Setup dialog. Beneath each database name are properties specific to your database type and file, such as tables and fields, joins, SQL statements, etc. The following views may be available:

Closed Multi-Database Join

If you wish to use multiple databases, you must join them by identifying the relationship between them. Using the Multi-Database Join property page, you can specify these relationships using database joins. A database join (or simply, a join) tells BarTender how data in multiple tables or databases is related. Typically, this means identifying a field that exists in both databases. For more information, refer to About Table and Database Joins.

ClosedTo define a multi-database join

  1. Click on the Join selector and select the type of join you'd like to use. For more information, refer to Database Join Types.

  2. Click [Left Operand] and select the database field from your left table.

  3. Click on the Operator and select the operator you want to use. An operator determines the relationship between the two tables.

  4. Click [Right Operand] and select the database field from your right table.

  5. Optionally, to add another join, click the icon and repeat steps 1-4 for the new join condition.

Closed Connection Properties

The Connection Properties property page displays information about the database connection. From the Connection Properties property page, you can change the database file, configure the database connection, and create a named database connection which can be referenced by other documents.

The following options are available:

For more information on named database connections, refer to About Named Database Connections.

Closed SQL Statement

The SQL Statement property page lets you write custom SQL statements for the connected record set.

By default, this property page displays the SQL statement that is generated automatically by the user's settings on the Filter, Tables, and Sort Order property pages of the Database Setup dialog. The Specify a custom SQL statement option is intended for advanced users who are experienced in writing their own SQL statements and who want the ability to do so.

To create a custom SQL statement, enable Specify a custom SQL Statement (Advanced), and enter your SQL statement in the field provided on the page.

SQL is an advanced programming tool used by database programmers. If you decide that you want to learn SQL, we recommend that you obtain qualified SQL instruction or complete self-study with a SQL programming book.

Closed Tables

The Tables property page displays a Tables list where you can view the tables that are available for use in your document. By clicking in the Alias column for a listed table, you can specify an alias or alternate name for the table. An alias lets you refer to a specific table, even if the document is set up to reference it by a different name. By assigning an alias for the table name, all references to the table will be maintained. For more information, refer to Assigning Aliases to Tables and Database Fields.

If you are connected to two or more tables, you must join them by identifying the relationship between them. Using the Join Conditions section, you can specify these relationships using database joins. A database join (or simply, a join) tells BarTender how data in multiple tables or databases is related. Typically, this means identifying a field that exists in both tables. For more information, refer to About Table and Database Joins.

Closed Fields

The Fields property page displays all of the database fields present in the selected table(s) of your database, alongside detailed information about the data type and length of the data contained in that field. By clicking in the Alias column for a listed field, you can specify an alias or alternate name for the database fields. An alias lets you refer to the database field, even if the document is set up to reference it by a different name. By assigning an alias for the field name, all references to the old field will be maintained. For more information, refer to Assigning Aliases to Tables and Database Fields.

Closed Sort Order

The Sort Order property page lets you sort the data by one or more fields in your database. To choose a field to sort by, simply move it from the Available Fields column to the Sort Fields column by dragging or double-clicking the field name. Once a field is added to the Sort Fields column, you can choose to sort in ascending (1-9, A-Z) or descending (Z-A, 9-1) order.

You may want to sort your data by more than one field. By doing so, any data with identical data in the first field will then be sorted by the second defined field. For example, you may have two fields in your database: Department and Employee. You can first sort by Department, so that all employees of the same department are grouped together. Then, you can sort by Employee to place the names in alphabetical order within each department.

Closed Filter

The Filter property page allows you to specify search criteria that will determine which records from your database are printed. Filter statements are structured like a sentence comparing a database field to a value, such as "First Name starts with J". For a filter such as this, only records whose first name starts with a "J" will be printed. You can also define query prompts, which allow you to enter the filter criteria at print-time. For more information, refer to Creating a Query Prompt.

Any filters that you define using this dialog are applied before you print your items. If you wish to view and filter all records at print-time, the record selection tool provides interactive filtering for the user. Filtering the records on the Filter property page is recommended in the following circumstances:

For more information on interactive filtering, refer to Filtering Data.

Closed Options

The Options property page allows you to set row options for the database:

Closed Record Browser

The Record Browser property page displays the data in the selected database. By viewing the records, you can verify that your table joins, filters, and sorting options have been properly specified.

Closed Record Browser (Joined)

The Record Browser (Joined) property page displays the data that is available from your joined connected databases. By viewing the available records, you can verify that your database joins, filters, and sorting options have been properly specified.

Database Setup Dialog Toolbar

The following icons are available at the bottom of the left Navigation pane:

Refreshing the Database

Sometimes as part of designing items to print, you may need to make changes to your database. For example, an ODBC database may require changes to the structure of the database or to the configuration of the ODBC driver used to read the database. A text or Excel file may need changes to the field names. Any such changes to any database type will be automatically detected when first opening a document. However, if changes are made to the database while a document is open, BarTender has no way of automatically detecting these changes.

Click after you perform any function in the Database Setup dialog that might cause important changes. BarTender will reload the structure and configuration of the named ODBC databases and refresh the field names of any text files.

Related Topics