Attaching Codesoft 7 to an ODBC Database
1. From your Main Menu Options, go into Merge then Create/Edit query. The following Dialog Box will appear.
2. Select the button
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 7. It can be found in the Data folder under the
Libraries 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 7\ Libraries\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:\….\Libraries\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 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; “RISKR2” and “RISKR3” 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.
15. 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, you will also want to save the query. 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. Click OK. 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 “Merge”, “Create/Edit Query”
8. Click on the button
9. Click on “add”,
10. Select the “Microsoft Excel driver (.xls)”, click on “OK”
11. Now give it a name “Data Source Name” that you will recognize later.
12. Click on “Select” and select the directory that the excel resides in, click
“OK”.
13.You’re now back to the ODBC setup screen Click “OK” again.
Click “Close”.
14. You are now at the “Query Definition” menu. In the Data Source box is a down arrow, click on it and select the name that you called the data source.
15. 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 OK.
The variables will now be listed under Database.