Results 1 to 5 of 5

Thread: What are error handlings in Visual basic?

  1. #1
    Join Date
    Mar 2010
    Posts
    515

    What are error handlings in Visual basic?

    Hey Guys, Can someone tell me what error handling in Visual basic 6.0 are? I don’t have a large amount acquaintance regarding Visual basic 6.0 but still I am not able get the perception of error handlings in visual basic. I am not able to find any link in it. But, I am not sure about it. I don’t have any clue regarding this topic. So, if anyone who has any knowledge or information about this than let know.

  2. #2
    Join Date
    May 2009
    Posts
    637

    Re: What are error handlings in Visual basic?

    The On Error statement is used to trap the run-time errors and not the syntax errors. It has the following three forms: 1. On Error GoTo LineLabel LineLabel is a label given to a specific line. It must be in the same procedure as the On Error statement. When a run-time error occurs, the program jumps to that label. The code following the label must handle the error. On Error Resume NextIf a run-time error occurs, the line which generated the error is skipped and execution is continued with the next line. On Error GoTo 0It is used to turn off error handling. Any error occurring after this statement will cause a run-time error.

  3. #3
    Join Date
    May 2009
    Posts
    527

    Re: What are error handlings in Visual basic?

    The Err object holds information about an error that has occurred. It is a predefined object and hence requires no declaration. It must be noted that the properties of the Err object are cleared whenever execution is transferred to another procedure or a Resume statement is executed. Err object has the following important properties and methods are Source Property in which it contains the name of the object or application that caused the error. Number Property It contains the error number which may range from 0 to 65535.

  4. #4
    Join Date
    Apr 2009
    Posts
    488

    Re: What are error handlings in Visual basic?

    You can also use a Description Property in which it contains the description of the error. Then, we have is Raise Method where it is used to generate run-time errors. If an error occurs that you had not anticipated and coded for, this method is used to generate that error so that a dialog box is displayed describing the error. Syntax Err.Raise ErrorNumber [, Source] [, Description] [, HelpFile] [, HelpContext] ErrorNumber is the only compulsory argument.

  5. #5
    Join Date
    May 2009
    Posts
    529

    Re: What are error handlings in Visual basic?

    After solving the error, the program should continue execution if possible. The Resume statement is used for this purpose. The Resume statement has the following three forms such as Resume it is used to continue execution with the line that caused the error. If the error-handling routine calls a different procedure that contains a Resume statement, execution continues with the line that called the second procedure. Resume Next It is used to continue execution with the line following the line that caused the error.

Similar Threads

  1. Runtime Error 91 in Visual Basic 6
    By Trance Maniac in forum Software Development
    Replies: 6
    Last Post: 24-12-2010, 11:36 PM
  2. Visual Basic Runtime Error 2147467259(8000405)
    By Sophia in forum Software Development
    Replies: 3
    Last Post: 04-04-2010, 11:04 AM
  3. Run-Time Error 713 in Visual Basic
    By austin26 in forum Software Development
    Replies: 4
    Last Post: 26-11-2009, 04:58 PM
  4. Visual Basic Error 400
    By Abejar in forum Software Development
    Replies: 2
    Last Post: 12-05-2009, 01:38 PM
  5. Visual Basic Error? in Microsoft Office 2003
    By CostasD in forum MS Office Support
    Replies: 5
    Last Post: 04-12-2008, 02:12 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,520,207.29016 seconds with 17 queries