Andrea Cappelli
unread,Nov 9, 2012, 2:35:33 AM11/9/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
Hi,
I'm trying to access a MS Sql Server from a python script using SQL Alchemy.
If I use pymssql driver everything works well, except I receive a warning about Decimal field converted to float, with some possible data loss; so I tried to switch to pyodbc driver that shouldn't have this issue, but was not able to configure it on my Ubuntu 12.04 box, I receive the following error:
sqlalchemy.exc.DBAPIError: (Error) ('IM004', "[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)") None None
In my virtualenv there is:
1) pyodbc==3.0.6
2) SQLAlchemy==0.7.9
and I have set up the conf file /etc/odbc.ini as follows
[handle]
Driver = /usr/lib/x86_64-linux-gnu/libodbc.so.1
Description = description
Server = $db_host
Port = 1433
TDS_Version = 8.0
I use the following uri when connecting: mssql+pyodbc://user:pass@handle
I have the following packages installed:
unixodbc
unixodbc-dev
freetds-dev
tdsodbc
python-dev
Anyone has a similar setup or can point me towards a saolution for thsi issue?
Best regards