Skip to Content
0
Former Member
Apr 22, 2016 at 09:30 PM

Linux Advantage Database Server ODBC Driver with PyODBC

286 Views

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!

(Please note this is a duplicate from http://stackoverflow.com/questions/36803560/pyodbc-connection-with-advantage-odbc-driver-linux)