I found two fixes for the crash. Now I need one of you brilliant folks to tell me which is correct. First, here is a snippet from adodbapi. Look closely at the comments on the last three lines of code ... v v v v v v v v v [... Snip ...] [ (Note: lines below are paraphrased -- not quite the actual code) ] def connect(connection_string): pythoncom.CoInitialize() conn = win32com.client.Dispatch("ADODB.Connection") conn.ConnectionString = connection_string conn.Open() return Connection(conn)
class Connection(object): __init__(self,conn): self.adoConn = conn self.messages = [] [... snip ...] def _closeAdoConnection(self): #all v2.1 Rose """close the underlying ADO Connection object, rolling it back first if it supports transactions.""" if self.supportsTransactions: self.adoConn.RollbackTrans() self.adoConn.Close() def close(self): self.messages=[] try: self._closeAdoConnection() #v2.1 Rose except (Exception), e: self._raiseConnectionError(InternalError,e) del self.adoConn #### adding this line cures the crash #### or pythoncom.CoUninitialize() #### removing this line cures the crash ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ So --- which is the correct correction? remove the CoUininitialize() or perform the explicit del of the Dispatch object? --- Vernon
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32