I'm nearly there with my new server, but I'm having trouble getting an ODBC connection to a Sybase Advantage 7.1 server. It worked on the old server, but it is broken on the new server for whatever reason.

Here's the PHP code:

$conn = odbc_connect("QuotaMaker", "", "");
echo "<br>Connection result: ".$conn."<br>";

Which gives the result:

Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't
 open lib '/usr/lib/libadsodbc.so' : libace.so.8.00: cannot open shared object file:
 No such file or directory, SQL state 01000 in SQLConnect
Connection result: 

The file is clearly there:

inet:/usr/lib > dir libads*
-rwxr-xr-x 1 root root 1736720 Jun  9 10:11 libadsloc.so
-rwxr-xr-x 1 root root  389332 Jun  9 10:11 libadsodbc.so

The ODBC.INI entry (modified from the Sybase ODBC Help Doc):

[ODBC Data Sources]
QuotaMaker  = QuotaMaker Database

[QuotaMaker]
Driver          = /usr/lib/libadsodbc.so
Description     = Advantage ODBC driver
DataDictionary  = \\qm01\qmaker
Rows            = False
Collation       = ASCII
MemoBlockSize   = 64
DefaultType     = Advantage
MaxTableCloseCache = 0
LOCKING         = File
CharSet         = OEM

Also created the environment variable per Sybase instructions:

inet:/usr/lib > echo $ODBCINI
/etc/unixODBC/

Any clues? I haven't rebooted the server since I made all these changes - is that a problem?

Thanks in advance.

    I took another look at the error and realized it wasn't asking for the "libadsodbc.so" file, it was asking for the "libace.so.8.00" file. I didn't have that file, but I did have a "libace.so", so I created a symlink to that file and it seemed to help.

    Unfortunately, the connection still fails, but for other reasons now. Here's the new error:

    Warning: odbc_connect(): SQL error: [unixODBC][Extended Systems][Advantage 
    SQL][ASA] Error 6060: Advantage Database Server not available on specified 
    server. axServerConnect, SQL state S1000 in SQLConnect in

    I'm thinking the problem has to do with the driver version (ADS 7.1 versus whatever version driver I have). Any thoughts?

      Write a Reply...