Automating Database Printing |
BarTender documents can be designed to read data from one or more database connections, such as text files or OLE DB and ODBC data sources. Database connection settings are configured by using the Databases collection object, which is a list of individual databases. Each Database object in the collection contains settings that are specific to the database type.
BarTender database connections can be controlled and modified by using ActiveX Automation. Many common methods for controlling database connections are supported, including the following:
Changing a Text File database connection's file name
Changing an OLE DB and ODBC SQL query statement
Setting query prompts that are defined in a document
The following example shows how to set a file name for a Text File database connection.
Custom SQL statements can be run on a connected database to perform record filtering when data is browsed or to select database records at print time. To apply a custom SQL statement, use the Database.SQLStatement property.
The following example shows how to set a custom SQL statement.
A query prompt, which is defined as part of the attached database, is used to select the records that are used when a print job runs. The Format object contains a list of all of the query prompts that are defined for a BarTender document. These are stored in the QueryPrompts collection object.
The following example shows the use of query prompts via ActiveX Automation.
Related Topics