exception question

  • Thread starter Thread starter Cc
  • Start date Start date
C

Cc

just dumb question,
is system.exception is a global exception? for example rather than use
odbcexception to catch odbc error I can use system.exception
 
just dumb question,
is system.exception is a global exception? for example rather than use
odbcexception to catch odbc error I can use system.exception


Hi,

Yes, System.Exception is the highest level of exception. From there, you
can catch specific exceptions such as ODBCException.

So, if you go:

Try

'Blah

Catch e as Exception

End Try

It'll catch any exception that occurs in the Try block.
 
But you can also trap for more than one kind of exception and if you are
doing this, be sure to trap for the system.exception LAST since every
exception is a form of an exception.
 
Back
Top