contents.gifindex.gifprev1.gifnext1.gif

ODBC: Designating the Host Data Source

You need to tell the runtime system which data source to use for your ODBC file. You accomplish this by setting the configuration variable A-ODBC-DATASOURCE to the exact name that you set up in the Windows ODBC driver manager. You can set this variable in your COBOL configuration file if you will be using only one data source.

For example, if the data source you want to select is listed in the control panel ODBC window as:

MS Access Databases (Access Data (*.mdb))


you should add the following line to your configuration file:

A-ODBC-DATASOURCE MS Access Databases


If you used the Add option to configure a new data source driver, set A-ODBC-DATASOURCE to the personalized name that you entered in the Add window.

If you do not know the data source name in advance, or if you intend to use more than one data source, you may set the data source name dynamically at runtime. In your COBOL program, you would add code similar to this prior to the statement that opens the file:

SET ENVIRONMENT "A-ODBC-DATASOURCE" TO
"MS Access Databases"

IMPORTANT

You are now ready to use the sql.acu program.

After you learn about and use this utility, you will next find out about preparing and compiling your COBOL program , followed by learning to use the demonstration program.