I'm able to connect and execute sql using isql without issue:
isql -v MyDbODBC username password
But when I connect through SqlAlchemy using:
sqlalchemy.url = mssql://username:password@/?dsn=MyDbODBC
I get:
DBAPIError: (Error) ('00000', '[00000] [iODBC][Driver
Manager]dlopen(FreeTDS, 6): image not found (0) (SQLDriverConnectW)')
None None
Any Ideas? What exactly does "Image not found" mean?
Thanks!
TJ
I run this in the context of Pylons...a sqlalchemy only example:
>>> import sqlalchemy
>>> engine = sqlalchemy.create_engine('mssql://username:password@/?
dsn=MyDbODBC')
>>> con = engine.connect()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/engine/base.py", line
1231, in connect
return Connection(self, **kwargs)
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/engine/base.py", line
538, in __init__
self.__connection = connection or engine.raw_connection()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/engine/base.py", line
1286, in raw_connection
return self.pool.unique_connection()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 142, in
unique_connection
return _ConnectionFairy(self).checkout()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 323, in
__init__
rec = self._connection_record = pool.get()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 180, in
get
return self.do_get()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 615, in
do_get
con = self.create_connection()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 145, in
create_connection
return _ConnectionRecord(self)
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 217, in
__init__
self.connection = self.__connect()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/pool.py", line 280, in
__connect
connection = self.__pool._creator()
File "/Users/tninneman/Development/twopeas/lib/python2.5/site-
packages/SQLAlchemy-0.4.8-py2.5.egg/sqlalchemy/engine/strategies.py",
line 80, in connect
raise exceptions.DBAPIError.instance(None, None, e)
sqlalchemy.exceptions.DBAPIError: (Error) ('00000', '[00000] [iODBC]
[Driver Manager]dlopen(FreeTDS, 6): image not found (0)
(SQLDriverConnectW)') None None
>>>
TJ
What is mac using to connect to mssql? For example on unix there is a
freetds (free version of ms driver for sql server) and unixodbc. If
mac is using the same thing then you can try:
http://lucasmanual.com/mywiki/PythonManual#head-0e30402e75b2d4a8a032e6830813b779a34636e3
aka.
install unixodbc, crate driver name and connect using the connection
string mentioned there.
Lucas
ok.
I'll test it out on monday..
http://www.sqlalchemy.org/docs/05/reference/dialects/mssql.html#connecting
ps. I miss the "one page" documentation(easier to search) , is that
available or can be done with sphinx?
Thanks,
Lucas
On Fri, Jan 9, 2009 at 4:46 PM, Rick Morrison <rickmo...@gmail.com> wrote:
> The MSSQL connection string changed for the 0.5 final release. In
> particular, the "dsn" keyword is removed, and the pyodbc connection string
> now expects the DSN to be named where the "host" was previously placed, so
> the new connection URL would be:
>
> mssql://username:password@MyDbODBC
>
ps. I miss the "one page" documentation(easier to search) , is that
available or can be done with sphinx?
download the PDF, that's what it's for. I dont update it quite as
frequently as the HTML docs tho.