Attaching Codesoft 6 to an ODBC Database 1. From your Main Menu Options, go into Merge then Create ODBC query. The following Dialog Box will appear. 2. Select the button with 3 dots ( ) on it.
3. The Data Sources Dialog box lists all of the data sources that have been created. Since we haven t created one yet, we need to click on the Add button. 4. We now need to select our ODBC driver. The ODBC driver we select is dependent upon the type of database that we are connecting (merging) to. For the purpose of this instruction manual, we ll say that we are going to attach to an Access database and the database file name is CHEMICAL.MDB. This is an actual Access database supplied as an example in Codesoft 5. It can be found in the DATA subdirectory of Codesoft. Since we know our database is an Access database, we highlight the Microsoft Access Driver (*.mdb) and click on the FINISH button. This brings up the following Dialog Box.
5. This is the Dialog Box where we enter a Data Source Name and select our database file. Begin by typing in a data source name. You can also enter in a Description, but it is not required. For this example the data source name is CHEMICAL 6. Next we need to select our database file. Click on the Select button. The following Dialog Box appears. Change the directory to the DATA subdirectory of Codesoft \samples\data. All of your databases will be listed. Highlight the database file CHEMICAL.MDB. Then click on OK. This will bring us back to the previous Dialog Box, shown on the next page.
Notice that next to Database:, our path to the actual database file is now listed. This path in the above example is C:\..\SAMPLES\DATA\CHEMICAL.MDB. 7. We can now click on OK and our data source will be created. This is shown below.
8. To finish up our data source creation, we need to click on OK. Then we ll be back to the ODBC Query Definition Dialog Box. 9. We are now finished with creating our data source. We can select our data source, so it can be used with Codesoft. To do this, we click on the down arrow key on the right hand side of the Data source text box. This produces a list of all the data sources we have on our computers. This should look something like the example below. Select the data source you created. For my example, I ll select CHEMICAL. After selecting your data source, a list of Tables will appear under Tables. Depending on the database, you may only have one table, or you could have many. This example only has one Table and it is called CHEMICAL. 10. To select the fields that that should be used on the label, click on table CHEMICAL. This will make all of the fields appear. Select which fields are to be on the label by clicking on them or click on select all.
In this example only three fields are going to be used; RISKR1 and RISKR2 and RISKS1. Any combination of the fields could be selected, including all of them.
11. The variables will appear in the Data Source section under database. To place the variables on the label click and drag them onto the label as any variable is placed on a label. The data that will print out will be coming from the Access database called CHEMICAL.MDB. 12. The database can be scrolled thru by using the scroll tools 13. A search on the database can be performed by using the search tool 14. Printing can be done in various ways One way is to go to the Print Screen as in any print job Click on Print to print the label displayed on the screen Click on Merge to print the whole database 16. Or a portion of the database can be selected for printing by using the View/Print from query tool
If you select this function the screen below will appear. By using this screen a portion of the database can be selected or multiple copies of individual records can be selected as shown on the next page.
. The leftmost column shows the number of copies to be printed of that record. To activate the print, click on the printer icon at the top of this screen 14. When you save this label, another save Dialog Box will appear besides the normal Save Label Dialog Box. This Dialog Box is seen below. You ll want to select Yes here. This will save your database connection (merge) with the fields that you selected. Codesoft will save this as a Query file. All Query files should be saved in the Query subdirectory of Codesoft. **SIDE NOTE** Make sure that under Tools then Options from the Main Menu, you have the Open Merge Database check box checked. Now, whenever a label file that has a saved Query file associated with it is opened, the database will automatically be merged.
Importing an Excel Database Using CS ODBC Link When working with an Excel spreadsheet, certain parameters must be met for a smooth transition between Codesoft and Excel. Follow the instructions below. 1. Set up your Excel file as usual 2. Highlight all of the records to be connected to CodeSoft Go to "Format", "Cells", then under the "Number" index tab be sure that "Text" is selected. This will format all of the highlighted cells as text cells. Now with all the records still highlighted go to Insert, name, define. The name or information that is in the upper left cell will be upper box on the menu. You must then click on ADD so it goes into the lower box. Then click on OK 4. Click on File, Save As. Save it to a directory or folder that you will recognize for future use. 5. Close Excel 6. Open CodeSoft 7. Go to Data, Open ODBC database 8. Click on the button with the three dots to the right of the Data Source box, click on add, select the Microsoft Excel driver (.xls), click on OK Now give it a name Data Source Name that you will recognize later. Click on Select and select the directory that the excel resides in, click OK. You re now back to the ODBC setup screen Click OK again. Click Close. You are now at the Merge Database menu. In the Data Source box is a down arrow, click on it and select the name that you called the data source. In the Tables area will appear the name of the first cell in your Excel file. Select it and your fields will appear in the field box. Select any or all of the fields you wish to use on your label. Click on the View button to ensure that you have connected to the Excel file. You will see your data listed. Now click on OK. CodeSoft will prompt you Do you want to create variables. Click on YES and position you variables as usual on your label.