I am trying to connect to an existing Sybase Advantage Database Server via the ODBC driver on a LOCAL instance. I currently have unixodbc, unixodbc-dev, and unixodbc-bin installed.
When I attempt the following:
import pyodbc
str='DRIVER={Advantage ODBC Driver};DataDirectory=/var/lib/advantage/.../dbfile.add;User ID=...;Password=...;ServerTypes=1;'
connection = pyodbc.connect(str)
I get the following error:
pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')
Here's my /etc/odbc.ini (and /etc/odbcinst.ini) file:
;
; odbc.ini
;
[ODBC Data Sources]
Odie = Advantage ODBC Driver
[Odie]
Driver=/opt/ads/odbc/redistribute/libadsodbc.so.11.10.0.24
DataDirectory=/var/lib/advantage/.../dbfile.add
Description=Advantage ODBC driver
Rows=False
MemoBlockSize=64
DefaultType=Advantage
MaxTableCloseCache=0
LOCKING=Record
CharSet=OEM
ADVANTAGELOCKING=OFF
ServerTypes=1
TableExtension=
I see three potential issues here - either my connection string is wrong, my odbc.ini file is incorrectly setup, or my unixodbc hasn't reloaded the odbc.ini since I modified it (if there is such a thing). I have attempted the solution proposed here, without avail.
Thanks for your help!
isql? Try connecting withisqlverbose:isql -v dsn username password, and have a look at the log.[01000][unixODBC][Driver Manager]Can't open lib '/opt/ads/odbc/redistribute/libadsodbc.so.11.10.0.24I attempted the same with sudo, but no change. I checked for permission problems; all parent folders have permissions of rwxr-xr-x and the said file has rwxr-xr--. I also attempted to see if the path wasn't good by doing aif [ -f path ], and without sudo it returned true. :scratch-my-head:libadsodbc.so.11.10.0.24to/, 777'ing it, and changing the config to point to the file in/? Then you could verify whether or not it is a permissions issue, and move the file down the folder tree one step at a time. Ugly, but debugging normally is! :)user@computer:/$ ls -layielded the following entry:-rwxrwxrwx 1 root root 338030 Apr 23 08:59 libadsodbc.so.11.10.0.24ldd /opt/ads/odbc/redistribute/libadsodbc.so.11.10.0.24to see if any of the dependencies of the library are missing?