Connect to Text File
Text File database can be used as a dynamic data source for label objects or form objects.
Text files require some additional work before they are transformed into a "real" database. At the start, any text file contains data values but has no information about the data structure, name fields, and maximum field lengths. These missing parameters need to be specified before the text file turns into a database that can be used as an object data source.
Example 52. Example:
A widely used text database example are .csv files. In a .csv file, a delimiter separates the database fields. Each line provides the data for a single label – therefore, it can be understood as a "record" in database nomenclature.
Open the Dynamic Data Manager. This dialog enables the user to manage the variable data sources for label and form objects.
Click Database Connections button in the Dynamic Data Manager ribbon and select Text File as the preferred database type.
To manually connect an object to a text file database, complete the below-listed steps.
Step 1: Connection Setup
Connection Information window defines the database file details.
-
File name defines the file location.
-
Test Connection: starts a connection testing procedure. It shows whether or not a connection with the database has been established. A confirmation or error message appears depending on the connection status.
Click OK when done. Database properties window appears.
Database Connection group defines the connection name and describes it.
-
Connection name: defines the name for the connected database file. By default, it displays the filename of the connected file. Insert a new name to make it easy to be found in the Desktop DesignerDynamic Data Explorer.
-
Description: allows adding additional information and suggestions for the connected database.
-
Connection: identifies the currently connected database file. To replace the currently connected file, click the Connection Setup button. New Database Connection Properties window reappears – repeat step 1 to connect to an alternative database file.
Step 1a: Text File Structure Wizard
Text File Structure Wizard window opens if a structure for a text file you are connecting hasn't been defined previously.
The steps for completing the Text File Structure Wizard are described in a dedicated section.
Note
After finishing this procedure, a text definition .sch file with the same name as the text database file and is created in the same folder. Next time the wizard is used on the same file, this procedure is no longer required.
Step 2: Configuration of Database Tables and Fields
Read about how to configure the connected table here.
Read about how to configure the database fields here.
Click OK when done.