Database Connection Commands

/UID=<userID>

When using ODBC data sources, the /UID and /PWD can be specified to log into the ODBC databases. The /UID and /PWD are applied to all ODBC databases found. If /UID is provided and /PWD is not, then it is assumed that the /PWD is "". The /UID must be used when /PWD is used.

/PWD=<password>

When using ODBC data sources, the /UID and /PWD can be specified to log into the ODBC databases. The /UID and /PWD are applied to all ODBC databases found. If /PWD is provided the /UID must also be provided.

/RecordRange=<range>

Specifies a range of records to be printed. For example:

/RecordRange=1,3,7-10,50…

When using /RecordRange you must be explicit as to whether or not the file specified by /D contains a header record or not. Use /DbTextHeader to indicate that the new database has a header record.

/D=<path to data file>

Sets or changes the file-based database to be used, such as text, Excel, XML, JSON, and SAPIDoc files. All other database types (SQL, Oracle, Access, etc.) are ignored.

When there is only one file-based database connection, or multiple file-based databases of the same type, /D can be used to provide a substitute database for the first connection. No analysis of the file contents is performed.

When there are multiple file-based database connections of different types, the file extension is analyzed to determine which database type the /D command relates to. The first database of the determined type is replaced by the /D file name. Only file extensions are analyzed. No analysis of the file contents is performed.

Unknown extensions are treated as text file databases. For example, any file extension other than .xml, .json, .xls, .xlsx, or .idoc is treated as a text file database. If no compatible types are found, an error is displayed and no database connection is created.

The /D command can be used to create a new database connection, but only when there are no existing file-based database connections of any type defined, and it can only create a text file database connection. BarTender assumes that the first line of the file is a header that contains the field names and that the data fields are delimited with the mixed-quote-and-comma method.

The /D parameter applies to all open BarTender documents unless the /AF= parameter has been used. A full path to the database may need to be specified.

For more information, refer to How BarTender Processes Path and File Names.

The /D parameter affects only document-level database connections. Database connections associated with document objects or data entry controls, such as a table object or list box control, are not supported by the /D parameter. You can use BTXML script as an alternative method for manipulating databases that are linked to objects and controls.

/DbTextHeader=<number of record containing field names>

Indicates that the text file database specified by /D contains a header.

/?<query prompt name>="<query prompt value>"

Assigns a value to the specified query prompt. If there is no match, then the command is ignored. If a query prompt within the document is not set, then the query prompt dialog will be displayed with the remainder of the unset prompts. Multiple query prompts are supported on the command line. Setting query prompts only takes effect when /P, /PD, /FP, or /FPD are specified.

/DD

Deletes all databases specified by the /D command line parameter when BarTender finishes all processes related to those databases.

/W="<where clause>"

Sets the where clause for record selection within an ODBC database. The where clause will be applied at the time of data browsing or at the time of printing to perform record filtering. The /W option uses the Custom SQL option. If you do not already have a custom SQL statement defined, then one will be generated automatically. The custom SQL statement is parsed for the first occurrence of the WHERE string in your custom SQL statement, and will replace all remaining text with the contents of the <where clause>. If a WHERE clause is not found in your custom SQL statement, then the <where clause> value will be placed at the end of your SQL statement.

The /W parameter is obsolete, and is supported only for backward compatibility. Use the /?<query prompt name> option as an alternative.

/ITD=\path\<SAP definition file name>

Specifies the SAP definition file to be used. This changes a registry entry so that subsequent runs of BarTender will use this file. A full path to the file may need to be specified. For more information, refer to How BarTender Processes Path and File Names.

Related Topics