Hi,
I'm using the current svn version of SA and try to connect to a MSSQL
Server like this:
def connectSqlServer(server,database):
import adodbapi as dbapi
def connect():
return dbapi.connect("Provider=sqloledb;Data Source=%s;Initial
Catalog=%s;Integrated Security=SSPI;" % (server,database) )
return create_engine('mssql://', creator=connect, module=dbapi)
meta.connect(
connectSqlServer(server,database)
)
Here is the traceback I get from within Pylons:
File
'C:\\develop\\JustForFun\\pylons_test\\logView\\logview\\lib\\base.py',
line 15 in connectSqlServer
e = create_engine('mssql://', creator=connect, module=dbapi)
File
'c:\\develop\\justforfun\\sqlalchemy_svn\\lib\\sqlalchemy\\engine\\__init__.py',
line 92 in create_engine
return strategy.create(*args, **kwargs)
File
'c:\\develop\\justforfun\\sqlalchemy_svn\\lib\\sqlalchemy\\engine\\strategies.py',
line 39 in create
provider = self.get_pool_provider(dialect, u, **poolargs)
File
'c:\\develop\\justforfun\\sqlalchemy_svn\\lib\\sqlalchemy\\engine\\strategies.py',
line 67 in get_pool_provider
return threadlocal.TLocalConnectionProvider(dialect, url, **poolargs)
File
'c:\\develop\\justforfun\\sqlalchemy_svn\\lib\\sqlalchemy\\engine\\default.py',
line 18 in __init__
(cargs, cparams) = dialect.create_connect_args(url)
File
'c:\\develop\\justforfun\\sqlalchemy_svn\\lib\\sqlalchemy\\databases\\mssql.py',
line 249 in create_connect_args
return make_connect_string(opts)
File
'c:\\develop\\justforfun\\sqlalchemy_svn\\lib\\sqlalchemy\\databases\\mssql.py',
line 51 in <lambda>
make_connect_string = lambda keys: \
exceptions.KeyError: 'host'
What am I doing wrong? As far as I understand, host should not be
required if I pass a creator!?
regards,
Achim
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users