[sqlalchemy] PYODBC make_connection_string

2007-04-02 Thread El Gringo
Port has to be added to the connection string with pyodbc, the same way as adodbapi and pymssql def make_connect_string(self, keys): connectors = [Driver={SQL Server}] if keys.has_key(port): keys[host] = keys[host] + , + str(keys[port]) del keys[port]

[sqlalchemy] Re: Fix on ADODBAPI

2007-03-28 Thread El Gringo
On 28 mar, 12:30, Paul Johnston [EMAIL PROTECTED] wrote: Hi, The bit applicable toadodbapidoesn't consider the port at all (at the moment...) Check the current trunk, if port is specified, the port key is deleted and its value added to the key host with ''.join([keys.get('host', ''), ':',

[sqlalchemy] Re: Fix on ADODBAPI

2007-03-27 Thread El Gringo
Ok I saw fixes in the current trunk: class MSSQLDialect_pymssql(MSSQLDialect): def make_connect_string(self, keys): if keys.get('port'): # pymssql expects port as host:port, not a separate arg keys['host'] = ''.join([keys.get('host', ''), ':',

[sqlalchemy] Fix on ADODBAPI

2007-03-20 Thread El Gringo
I found that the conenctionString is not complete, the port is missing. Not like anywhere else, host and port must be separated by a comma ! def make_connect_string(keys): connectors = [Provider=SQLOLEDB] connectors.append (Data Source=%s,%s % (keys.get(host), keys.get(port, 1433)))

[sqlalchemy] Re: Fix on ADODBAPI

2007-03-20 Thread El Gringo
I also found that when trying to connect within a thread the connection hangs. I had to use pythoncom.CoInitialize(). Example: # import pythoncom import sys sys.coinit_flags = 0 pythoncom.CoInitialize() [ COM code here... ] pythoncom.CoUninitialize() More informations: