[00000] image not found error

1,484 views
Skip to first unread message

Matt

unread,
Aug 12, 2009, 2:05:01 PM8/12/09
to pyodbc
I get this error when trying to connect via pyodbc, i.e. using:
cnxn = pyodbc.connect
("Driver=FreeTDS;Server=xxx;UID=xx;PWD=xxx;PORT=xxxx;DATABASE=xxx;
TDS_VERSION=8.0;")

pyodbc.Error: ('00000', '[00000] [iODBC][Driver Manager]dlopen
(FreeTDS, 6): image not found (0) (SQLDriverConnectW)')

I'm confused since doesn't the 00000 indicate successful connection?
The thing is that I am able to connect successfully using a DSN
connection using the exact same settings and the error won't show,
i.e. using:
cnxn = pyodbc.connect("DSN=xxx;UID=xx;PWD=xxx;")

I've been able to connect dsn-less using other programs.

Just need help understanding the error or possibly how to fix.



mkleehammer

unread,
Aug 13, 2009, 10:11:37 PM8/13/09
to pyodbc
I'm pretty sure this means that the iODBC driver manage did not find
the FreeTDS library. This usually means that the ODBC INI file is not
correct.

You state you can connect DSN-less using other programs. Is it
possible they are using unixODBC instead of iODBC? (Or is this Mac OS/
X?).

Are you using the same connection string for the other programs are
there subtle differences?

Matt

unread,
Aug 14, 2009, 12:33:16 PM8/14/09
to pyodbc
Thanks for response. This is for Mac OS, and I'm using the iODBC that
comes with it. I actually found out that by explicitly defining the
location instead of using driver name got it to connect, i.e.
> cnxn = pyodbc.connect
> ("Driver=/usr/local/lib/libtdsodbc.so;Server=xxx;UID=xx;PWD=xxx;PORT=xxxx;DATABASE=xxx;
> TDS_VERSION=8.0;")

I'm still not sure why simply using the driver reference 'FreeTDS'
doesn't work however, so there's probably a hitch in my setup
somewhere.
My odbc files in any case:

odbcinst.ini:
[ODBC Drivers]
FreeTDS = Installed

[FreeTDS]
Description = FreeTDS driver (Sybase/MS SQL)
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsodbc.so

odbc.ini:
[ODBC Data Sources]
MyServer = FreeTDS

[MyServer]
Description = MyServer access via FreeTDS
Driver = FreeTDS
SERVERNAME = xxxx
DATABASE = xxx
PORT = xxxx

freds...@gmail.com

unread,
Nov 29, 2012, 1:30:59 AM11/29/12
to pyo...@googlegroups.com
I had the same problem.  It worked when I specifed the path of the libtdsodbc.so file, but not when I specified the name of an entry in odbcinst.ini.  In that case, it reported the "image not found" error.  My problem was that odbcinst.ini was in /opt/local/etc with the freetds.conf file, not in /etc where it belonged.  Moving it to /etc made it all work fine.

--Fred Stluka
Reply all
Reply to author
Forward
0 new messages