On Fri, Apr 18, 2008 at 11:07 AM, jason kirtland <[EMAIL PROTECTED]> wrote: > > Rick Morrison wrote: > > Yeah, I was under the impression that config args passed in via > > create_engine() ctor and via dburi were treated the same, but looking > > over engine/strategies.py, it looks as if they have two separate > > injection points. I'll see if I can get it to allow either, stay tuned. > > create_engine('mssql://h/db', connect_args=dict(odbc_options='bar')) > create_engine('mssql://h/db?odbc_options=bar') >
so to make it clear. > create_engine('mssql://h/db', > connect_args=dict(odbc_options='DRIVER={TDS};TDS_Version=8.0')) This doesn't append driver and tds version to connection string. Isn't connect_args for sqlalchemy specific actions and not for pyodbc connector string. create_engine('mssql://h/db?odbc_options=bar') this will work if I had a single option, but I will supply multiple options with '=' operator. Example: This string need to be appended to connection string when passed to pyodbc. 'DRIVER={TDS};TDS_Version=8.0' so If you guys don't mind making the whole expression double quotes we can move on to: create_engine("mssql://h/db?odbc_options='DRIVER={TDS};TDS_Version=8.0' ") but now the driver that I just supplied in (line 804), was previously added in 783 so now you have 2 drivers. which leads me to try: e = sqlalchemy.create_engine("mssql://xxx:[EMAIL PROTECTED]:1433/xxx?driver=TDS?odbc_options='TDS_Version=8.0'") this only takes the first argument "driver" and skips odbc_options solution : option 1: make it so mssql://xxx:[EMAIL PROTECTED]:1433/xxx?driver=TDS?odbc_options='TDS_Version=8.0' handles both parameters driver and odbc_options option 2: We either move line 804 above line 783 and then check if it includes driver already? line 784 if 'dsn' in keys: connectors = ['dsn=%s' % keys['dsn']] else: connectors = ["DRIVER={%s}" % keys.pop('driver', 'SQL Server'), 'Server=%s' % keys['host'], 'Database=%s' % keys['database'] ] line 804: if 'odbc_options' in keys: connectors.append(keys.pop('odbc_options')) or option3? 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 -~----------~----~----~----~------~----~------~--~---