Win32 ODBC - Exception List???

nrshapiro nospam.nshapiro at nospam.ix.netcom.com
Sat Feb 12 23:47:59 CET 2000


I can't find much documentation on the ODBC module for the Python Win32
module.  The only source I can find is the c++ source, and since I don't
know the interface between C++ and Python, nor internal issues, I am not
sure how to trap for the 6 errors I see there:

This was my best guess (template), and it doesn't work!

  try:
        retVal = curCNT.execute(sqlstmt)
  except DbiOpError:
        pass
  except DbiProgError:
        pass
  except DbiIntegrityError:
        pass
  except DbiDataError:
        pass
  except DbiInternalError:
        pass
  else:
        print "other error!"

How do I find the mapping of exceptions to ODBC errors?  The only way I seem
to be able to catch the exception without python dumping is:

  try:
        retVal = curCNT.execute(sqlstmt)
  except:
        pass

But I would like the error information (e.g., if it is an integrity error, I
need to know!)

Thanks in advance!

Neil






More information about the Python-list mailing list