Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

8.1.2 Defining an ODBC Source for Your Application

The first development task that needs to be accomplished prior to starting PowerCOBOL is to define an ODBC Source for the application.

An ODBC Source can be thought of as simply specifying to the ODBC manager a symbolic name that you wish to use in your application to describe an ODBC connection using a specific ODBC database driver to access a physical database.

The following figures may or may not match what you see on your particular operating system (depending on what software you have installed), but you should be able to perform the following tasks by using the instructions provided.

Open [ODBC Data Sources (32-bit)] from Control Panel to confirm whether that the proper ODBC support (drivers) has been installed on your system.

In Windows 8.1, you can open from [Control Panel] > [System and Security] > [Administrative Tools]. The main ODBC Data Source Administrator window is displayed:

Note

In Windows 7 (64-bit), ODBC Data Sources (32-bit) cannot be started from the Control Panel. Run "%windir%\SysWOW64\odbcad32" from the command prompt.

Figure 8.1 The main ODBC Source Administrator window

You will add a new user data source name (DSN). Make sure the User DSN tab is open, and click on the Add button. The Create New Data Source dialog box is displayed. Highlight the Microsoft Access Driver (*.mdb) as follows:

Figure 8.2 The Create New Data Source dialog box

Click on the Finish button.

The ODBC Microsoft Access Setup dialog box is displayed. Enter MYODBC for the data source name and Fujitsu COBOL Test for the description:

Figure 8.3 The ODBC Microsoft Access Setup dialog box

You also need to select a file (database) to bind this driver to. Click on the Select button in the ODBC Microsoft Access Setup dialog box. The Select Database dialog box is displayed. Navigate through the directories and find the "Test.mdb" database file:

Figure 8.4 The Select Database dialog box

Select "test.mdb" and click on the OK button. This will take you back to the ODBC Microsoft Access Setup dialog box shown in Figure 8.3. Click on the OK button.

This will take you back to the main ODBC Source Administrator window. Note that "MYODBC" has been added to the list of User DSN's. Although you should not set any additional options for this exercise, you may wish to highlight "MYODBC" and click on the Configure button.

This will give you an idea of some of the additional options that are available when developing these types of applications. Once you are back to the main ODBC Source Administrator window, click on the OK button. This will exit the ODBC configuration facility. You have now defined the new ODBC Source (MYODBC) you are going to use from PowerCOBOL.

This is a generic database source using the standard MS Access ODBC driver, and is thus not specific to PowerCOBOL.