Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Navigation: » No topics above this level «

Defining ODBC Data Sources

Scroll Prev Top Next More

To define a data source under Windows, use the Data Source Manager found in the Administrative Tools. Essentially you need to choose a driver (e.g. SQL Server, Access, etc.) and then customize the configuration, typically by specifying a database and perhaps a user and password (in which case you would not need to supply that information when connecting). The name which you assign to the data source will be the name you specify in the “-host=” argument of the SQLOP_CONNECT call.

Under Linux, you’ll probably need to install the ODBC package (see Installing ODBC) and then configure it either using the GUI tool ODBCConfig, or by manually editing the /etc/odbcinst.ini and /etc/odbc.ini files. (The MySQL ODBC connector installation will set up its entry in /etc/odbcinst.ini for you, so that’s a good place to start. You’ll probably need to consult the documentation for the connector to get the details needed for the /etc/odbc.ini entries.) As a non-definitive example, here are the contents of the /etc/odbcinst.ini and /etc/odbc.ini files from my CentOS 4 system:

cat odbcinst.ini

[MySQL ODBC 5.1 Driver]

Driver          = /usr/lib/libmyodbc5.so

UsageCount              = 1

cat odbc.ini

;

; odbc.ini configuration for Connector/ODBC

;

 

[ODBC Data Sources]

sakila = MyODBC 5.1 Driver DSN

 

[sakila]

Driver = /usr/lib/libmyodbc5.so

Description MySQL / Sakila / ODBC

SERVER = localhost

PORT   =

USER   = jack

Password =

Database = sakila

OPTION = 3

SOCKET =