[python-win32] Recovering from AODB Exceptions, possible?

Rex Corrovan rex555 at hotmail.com
Fri Feb 9 23:40:52 CET 2007


So I have a function that ries to add a record:

    def EntryAdd(self, dataDict):
        try:
            self._DBConn.MoveFirst()
            self._DBConn.AddNew()
            for key, value in dataDict.items():
                self._DBConn.Fields.Item(key).Value = value
            self._DBConn.Update()
        except pywintypes.com_error, e:
            print e
            print 'error text here'
        return True

So if the error already exists I get an exception, no problem, I handle and 
log it.

The problem here is that anything I now try to use this recordset for will 
throw an exception. Is there any way to recover from this without recreating 
the whole recordset?

Thanks

~rex

_________________________________________________________________
Don’t miss your chance to WIN 10 hours of private jet travel from Microsoft 
Office Live http://clk.atdmt.com/MRT/go/mcrssaub0540002499mrt/direct/01/



More information about the Python-win32 mailing list