Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Error Handler

Error Handler

Scheduled Pinned Locked Moved Visual Basic
helpdatabasequestion
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nishkarsh_k
    wrote on last edited by
    #1

    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?

    M N C 3 Replies Last reply
    0
    • N nishkarsh_k

      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?

      M Offline
      M Offline
      MohammadAmiry
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • N nishkarsh_k

        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?

        N Offline
        N Offline
        Nilesh Hapse
        wrote on last edited by
        #3

        Why are you using On Error Goto when you have Try... Catch block in VB.NET??

        1 Reply Last reply
        0
        • N nishkarsh_k

          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?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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 )

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups