On Mon, Aug 13, 2007 at 4:07 AM, Christophe de VIENNE <[EMAIL PROTECTED]> wrote: > > Hi all, > > I have checked out the trunk and am trying to run the unittests under > linux using pyodbc. > So far, the connection to the database is working, although I had to > name the freetds odbc driver "{SQL Server}", including the {}, so the > driver manager nows which one to use.
Sorry if this thread is old, but could somebody give me few pointers here.... How does your connection sting looks like. I am trying to connect to mssql via odbc with no luck. I am able to connect easly with pyodbc,and ceodbc but not with sqlalchemy. import sqlalchemy import pyodbc eng = sqlalchemy.create_engine("mssql:///?dsn=mydsn,UID=myusername,PWD=mypass",module=pyodbc) eng.echo=True metadata=sqlalchemy.BoundMetaData(eng) I get File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/strategies.py", line 57, in connect raise exceptions.DBAPIError("Connection failed", e) sqlalchemy.exceptions.DBAPIError: (Connection failed) (TypeError) function takes at least 1 argument (0 given) what is the proper statement to include usr and pwd in sqlalchemy? ("mssql:///?dsn=mydsn,UID=myusername,PWD=mypass",module=pyodbc) (does not work) ('mssql:///?dsn=mydsn;UID=myusername;PWD=mypass',module=pyodbc) (does not work) but I can easily do this and it works: import pyodbc cnxn = pyodbc.connect("DSN=MYDBNAME;UID=USERNAME;PWD=PASSWORD") cursor = cnxn.cursor() cursor.execute('select * from mytable') a=cursor.fetchall() print 'pyodbc',a Thanks, Lucas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---