Error Handler
-
Hello every one I am developing a application in VB 2005 I am using On Error Goto to handle errors. Now my issue is that I want to handle different type of errors in a function separately. That is like Do some thing if the database connection is not there Do some thing else if the data is not found And so on I am not able to identify the errors in that way.. I am able to displaying the error number and description provided by the error object. Is there any way to find out or a list of error numbers available?
-
Hello every one I am developing a application in VB 2005 I am using On Error Goto to handle errors. Now my issue is that I want to handle different type of errors in a function separately. That is like Do some thing if the database connection is not there Do some thing else if the data is not found And so on I am not able to identify the errors in that way.. I am able to displaying the error number and description provided by the error object. Is there any way to find out or a list of error numbers available?
Why are you still using this totally abandoned way of error handling?!!! Use Try...Catch instead:
Try . _YourCodeHere_ . Catch ex1 As DataException Catch ex2 As IOException Catch ex3 As Exception Finally . . . End Try
-
Hello every one I am developing a application in VB 2005 I am using On Error Goto to handle errors. Now my issue is that I want to handle different type of errors in a function separately. That is like Do some thing if the database connection is not there Do some thing else if the data is not found And so on I am not able to identify the errors in that way.. I am able to displaying the error number and description provided by the error object. Is there any way to find out or a list of error numbers available?
Why are you using On Error Goto when you have Try... Catch block in VB.NET??
-
Hello every one I am developing a application in VB 2005 I am using On Error Goto to handle errors. Now my issue is that I want to handle different type of errors in a function separately. That is like Do some thing if the database connection is not there Do some thing else if the data is not found And so on I am not able to identify the errors in that way.. I am able to displaying the error number and description provided by the error object. Is there any way to find out or a list of error numbers available?
So, in other words, you're not using the mechanism that allows you to do this, so you want to know why you can't do it ? Anything that VB.NET gets from VB6 is almost certainly a disaster.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )