Discussion:
[Firebird-odbc-devel] Accessing Firebird using ODBC from Python
Sidney Cadot
13 years ago
Permalink
Hello,

I am trying to get the Firebird/ODBC link to work via pyodbc (v2.1.7)
and unixodbc (v2.2.14), under linux (amd64).

I am using "libOdbcFb.so" that I extracted from
OdbcFb-LIB-2.0.0151.amd64.tar.gz, as provided on the Firebird ODBC
download page from SourceForge. It is possible for me to connect the
remote Firebird server using the unixodbc-provided "isql" program, and
do queries, so I know the ODBC link can work properly.

However, when I try to contact the database from python using pyodbc,
things start to go awry:

import pyodbc
conn = pyodbc.connect("dbname=remote:/the/db/name.fdb;user=XXX;password=YYY;driver=Firebird")
Traceback (most recent call last):
File "./get_db_info.py", line 81, in <module>
dbConnection = pyodbc.connect(dsn)
pyodbc.Error: ('H', '[H] [unixODBC][ (0) (SQLDriverConnectW)')

I tried to supply the "ansi = True" option to pyodbc.connect(), but
the result is even less encouraging; it yields a segmentation fault.

It is noted that I am able to use pyodbc to connect to other databases
(SQL server, mysql; postgresql).

Does anybody have ideas what may be going wrong here? Any suggestions
on what to try next?

Sidney
Werner F. Bruhin
13 years ago
Permalink
Sidney,
Post by Sidney Cadot
Hello,
I am trying to get the Firebird/ODBC link to work via pyodbc (v2.1.7)
and unixodbc (v2.2.14), under linux (amd64).
Can't help with your real problem, but I am curios why you are going
down the ODBC route instead of using native drivers.
Post by Sidney Cadot
It is noted that I am able to use pyodbc to connect to other databases
(SQL server, mysql; postgresql).
Have you looked at SQLalchemy and using the native drivers to connect to
this different db's?

http://www.sqlalchemy.org/docs/

Werner
Sidney Cadot
13 years ago
Permalink
Hi Werner,
Post by Werner F. Bruhin
Have you looked at SQLalchemy and using the native drivers to connect to
this different db's?
Not really. I would prefer to use ODBC at this time, although
SQLAlchemy is on my list of things to investigate. For now, I'd like
to get a fix for my ODBC problem.

Loading...