Catching a specific exception (from mxODBC)

Alessandro Bottoni Alessandro.Bottoni at think3.com
Wed Mar 15 16:18:39 CET 2000


I have the need to catch a specific exception coming from mxODBC:
"mxODBC.ProgrammingError".

Unfortunately, all these sintax seem to fail:

except mxODBC.ProgrammingError :

except ODBC.ProgrammingError :

except mxODBC.Database.ProgrammingError :

except ODBC.Database.ProgrammingError :

except ProgrammingError :

except DB_API.ProgrammingError :

except DB_API.Database.ProgrammingError :

The complete code block was:

SQLCommand = 'update ' + OutPutTable + ' set Description=\'' + Description +
'\' where SolutionNumber=' + SolutionNumber
try:
	Cursor.execute(SQLCommand)
except (mxODBC.ProgrammingError, mxODBC.OperationalError):
	ReportException()
	continue


Can anybody tell me how I can catch this, and only this, exception?

TIA

--------------------------------
Alessandro Bottoni
(Alessandro.Bottoni at Think3.com)
(alessandro.bottoni at libero.it)
Web Programmer
Think3 inc.
(www.think3.com)





More information about the Python-list mailing list