To use unixODBC with a SQL Anywhere database, configure an ODBC data source.
Configuring ODBC for SQL Anywhere
If EAServer is running, shut it down.
Change to the EAServer bin directory, and start SQL Anywhere with the default.db database:
./asa-init.sh ../data/default.db ./asa-start.sh -x "tcpip{MyIP=127.0.0.1; Host=localhost;Port=2638;DoBroadcast=no;BroadcastListener=no}" -n EAS_TEST_DB ../data/default.db
Change to the EAServer odbc directory.
On Solaris, source either odbc.sh (Bash shell) or odbc.csh (C shell).
On Linux, source odbc.sh.
Edit odbc.ini, and add these lines:
[EAS_TEST_DB] Driver =SYBASA Trace =no TraceFile =sql.log Port =2638 ServerName =EAS_TEST_DB TDS_Version =5.0
The value of ServerName must match
the value of the -n option in step 2.
On Solaris, there must not be a space between “ServerName =” and the value.
Change to odbc/bin, then use isql to verify that you can connect to the database:
./isql -v "EAS_TEST_DB" dba sql
A successful connection displays the SQL>
prompt.
If this error message displays:
./isql: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory
isql cannot find libreadline.so.4.
To rectify the problem:
Find libreadline.so.4 by running:
whereis libreadline.so.4
The output should look similar to:
libreadline.so: /lib/libreadline.so.5
Change to odbc/lib, and create a soft link to libreadline.so.4:
ln -s /lib/libreadline.so.5 libreadline.so.4
Change to odbc/bin, then use isql to verify that you can connect to the database:
./isql -v "EAS_TEST_DB" dba sql
Start EAServer, then start the Management Console.
In the Management Console, create a data source named “EAS_TEST_DB”:
Expand the Resources folder, right-click Data Sources, and select Add.
To test the connection, click Ping.