On Dec 23, 2010, at 2:16 PM, Pirate Fibonacci wrote:

> On Dec 23, 11:42 am, Michael Bayer <[email protected]> wrote:
>> 
>> If you want to see exactly what gets passed:
>> 
>> python>>> from sqlalchemy.engine.url import make_url
>>>>> from sqlalchemy.connectors import pyodbc
>>>>> pyodbc.PyODBCConnector().create_connect_args(make_url("mssql+pyodbc://Defau
>>>>>  lt"))
>> 
>> [['dsn=Default;Trusted_Connection=Yes'], {}]
>> 
>> There's a difference between your two tests in that one has 
>> username/password, the other not.
> 
> thanks a bunch..
> 
>>>> pyodbc.PyODBCConnector().create_connect_args(make_url("mssql+pyodbc://myid:m...@default"))
> [['dsn=Default;UID=myid;PWD=mypw'], {}]
> 
> this is what we expect, add the database to it..
> 
>>>> pyodbc.PyODBCConnector().create_connect_args(make_url("mssql+pyodbc://myid:m...@default/databasename"))
> [['DRIVER={None};Server=Default;Database=databasename;UID=myid;PWD=mypw'],
> {}]
> 
> driver is now gone!!
> 
> passing the database in via URL options/parameter syntax, we get what
> we expect..
> 
>>>> pyodbc.PyODBCConnector().create_connect_args(make_url("mssql+pyodbc://myid:m...@default?database=databasename"))
> [['dsn=Default?Database=databasename;UID=myid;PWD=mypw'], {}]
> 
> wish I posted this last week!
> 
> fyi,
> 
>>>> import sqlalchemy
>>>> sqlalchemy.__version__
> '0.6.4'
> 
> thanks

DSNs include a database name already so passing /databasename assumes a TCP 
host, documentation at http://www.sqlalchemy.org/docs/dialects/mssql.html#id1 


> 
> 
> -- 
> 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.
> 

-- 
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.

Reply via email to