Open topic with navigation
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 .
To open the Database Setup dialog
You can open the Database Setup dialog using one of the following methods:
-
Select Database Connection Setup from the File menu.
-
Click the icon on the main toolbar.
-
In the Data Sources pane of the Toolbox, open the for Database Fields. Select Database Connection Setup.
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, statements, etc. The following views may be available:
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.
To define a multi-database join
-
Click on the Join selector and select the type of join you'd like to use. For more information, refer to Database Join Types.
-
Click [Left Operand] and select the database field from your left table.
-
Click on the Operator and select the operator you want to use. An operator determines the relationship between the two tables.
-
Click [Right Operand] and select the database field from your right table.
-
Optionally, to add another join, click the icon and repeat steps 1-4 for the new join condition.
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 .
The following options are available:
-
Type: Displays the database type. If the database is a text file, Microsoft Access file, or Microsoft Excel file, you can click Browse to select a different file.
-
Configure Connection: Opens the Database Setup Wizard where you can change or configure database file (if applicable) and the database connection.
-
Create named database connection: Opens the Create Named Database Connection dialog, where you can enter a name for the current connection so it can be used by other BarTender documents. After you have created a named database connection, the following links become available:
-
Configure named database connection: Opens the Database Setup Wizard, where you can change or configure the named database connection.
-
Stop using named database connection: Causes your document to no longer use the named database connection. BarTender will make a separate copy of the connection settings that will be used only within this document. The named database connection will still be available to other documents.
For more information on named database connections, refer to About Named Database Connections.
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.
|
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.
The Fields property page displays all of the database fields present in the selected table(s) of your database, alongside detailed information about the 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.
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.
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 , 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:
-
Your filter remains the same for every print job.
-
You wish to limit the results that appear in the interactive record picker at print-time.
-
You are using a large database, where filtering the records before printing will improve performance.
For more information on interactive filtering, refer to Filtering Data.
The Options property page allows you to set row options for the database:
-
Distinct rows only: Select (check) when you do not want duplicate rows returned in the result set. When selected, BarTender returns only the first instance of a row if there are duplicate rows in the database. Not available for text and databases
-
Limit number of rows to: Select (check) when you want to limit the number of rows returned in the result set. Once selected, you can specify the maximum number of rows you want returned.
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.
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:
-
: Opens the Database Setup Wizard, where you can create a new database connection or use an existing named database connection.
-
: Deletes the selected database connection.
-
: Refreshes the database connection. See "Refreshing the Database", below.
Refreshing the Database
Sometimes as part of designing items to print, you may need to make changes to your database. For example, an 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