Configuring a datasource

unixODBC Driver Manager

This is a datasource template:

[sampledsn]
Description=Sybase ODBC Data Source
UserID=sa
Password=
Driver=Adaptive Server Enterprise
Server=sampleserver
Port=4100
Database=pubs2
UseCursor=1

Execute the following command to configure a datasource for the Adaptive Server ODBC Driver using the unixODBC command line tool:

#  odbcinst -i -s -f dsn template file

where dsn template file is the complete path to the Adaptive Server ODBC datasource template file. This creates entries for the datasource in the odbc.ini file.

NoteThe exact command you need to configure ODBC datasources depends on the ODBC Driver Manager you are using.

Sybase iAnywhere ODBC Driver Manager

The Sybase iAnywhere ODBC Driver Manager uses the information provided in the odbc.ini file to locate the driver and other connection information. The ODBCINI variable defines the location of the odbc.ini file.

StepsManually configuring the ODBC driver and datasource

  1. Create an odbc.ini file:

    [sampledsn]
    Description=Sybase ODBC Data Source
    UserID=sa
    Password=
    Driver=complete_path_to_libsybdrvodb.so
    Server=sampleserver
    Port=4100
    Database=pubs2
    UseCursor=1
    
  2. Set the ODBCINI environment variable to the complete path to the odbc.ini file.