create_engine('mssql://', creator=connect) with pyodbc broken

Issue #1193 resolved
Former user created an issue

I just wanted to use this form to pass "LANGUAGE=us_english" to pyodbc:

create_engine('mssql://scott:tiger@localhost/test?LANGUAGE=us_english')

but it did not worked, so I changed to use "creator" option, it still raise error to me.

def connect():
    return pyodbc.connect('DRIVER={SQL Server};SERVER=haojue;DATABASE=gxp;UID=sa;PWD=1;LANGUAGE=us_english')

create_engine('mssql://', creator=connect)

raising exception like this:

C:\Python25\lib\site-packages\sqlalchemy-0.5.0rc2dev_r5158-py2.5.egg
\sqlalchemy\databases\mssql.pyc in make_connect_string(self, keys)
    776         else:
    777             connectors = [% keys.pop('driver', 'SQL Server
'),
--> 778                           'Server=%s' % keys['host']("DRIVER={%s}"),
    779                           'Database=%s' % keys['database']('database') ]
    780             if 'port' in keys:

KeyError: 'host'

Comments (2)

  1. Log in to comment