On Sat, Mar 29, 2008 at 10:50 PM, Randall Smith <[EMAIL PROTECTED]> wrote:
>
> Paul Johnston wrote:
> > Hi,
> >
> > eng =
> >
> sqlalchemy.create_engine("mssql:///?dsn=mydsn,UID=myusername,PWD=mypass",module=pyodbc)
> >
> >
> > Try this:
> > eng =
> >
> sqlalchemy.create_engine("mssql://myusername:mypass@/?dsn=mydsn",module=pyodbc)
> >
> > Paul
>
> You shouldn't need to define a dsn. This "should" work:
>
> e = sa.create_engine('mssql://user:[EMAIL PROTECTED]:1433/tempdb')
>
So what you are saying here is that sqlalchemy will figure out what
driver to use? pyodbc or other?
I know in 0.3 version I would get:
File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/strategies.py",
line 52, in create
raise exceptions.InvalidRequestError("Cant get DBAPI module for
dialect '%s'" % dialect)
sqlalchemy.exceptions.InvalidRequestError: Cant get DBAPI module for
dialect '<sqlalchemy.databases.mssql.MSSQLDialect object at
0xb7807dac>'
I have tried this with svn version and I get:
>>> pm = sqlalchemy.Table('17000Z', metadata, autoload=True)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "sqlalchemy/schema.py", line 110, in __call__
return type.__call__(self, name, metadata, *args, **kwargs)
File "sqlalchemy/schema.py", line 226, in __init__
_bind_or_error(metadata).reflecttable(self,
include_columns=include_columns) File "sqlalchemy/engine/base.py",
line 1271, in reflecttable
conn = self.contextual_connect()
File "sqlalchemy/engine/base.py", line 1239, in contextual_connect
return Connection(self, self.pool.connect(),
close_with_result=close_with_result, **kwargs)
File "sqlalchemy/pool.py", line 178, in connect
agent = _ConnectionFairy(self)
File "sqlalchemy/pool.py", line 321, in __init__
rec = self._connection_record = pool.get()
File "sqlalchemy/pool.py", line 188, in get
return self.do_get()
File "sqlalchemy/pool.py", line 613, in do_get
con = self.create_connection()
File "sqlalchemy/pool.py", line 153, in create_connection
return _ConnectionRecord(self)
File "sqlalchemy/pool.py", line 216, in __init__
self.connection = self.__connect()
File "sqlalchemy/pool.py", line 279, in __connect
connection = self.__pool._creator()
File "sqlalchemy/engine/strategies.py", line 80, in connect
raise exceptions.DBAPIError.instance(None, None, e)
SystemError: 'finally' pops bad exception
Lucas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---