VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 11

Chapter 11 - Implementing Error-Handling Features in an Application

( Contents )

This chapter discusses error handling in Visual Basic applications. Being able to trap, identify, and handle errors is a vital part of developing a user-friendly application. Error trapping and error handling can provide important feedback to the user about why an error occurred. The information provided through error handling can also help the developer find, correct, and prevent errors.

Trapping and handling errors in an Executable is covered in this chapter as well as dealing with errors at design time while debugging a project.

You will learn different ways to trap errors when they occur and to handle different error situations. In this chapter, recommendations for creating common error handling procedures are provided along with examples of how error information should be presented to the user.

This chapter covers the following topics:

  • Setting error handling options
  • The Err object
  • Handling errors in code
  • The error handling hierarchy
  • Common error handling routines
  • The Error function
  • The Error statement


  1. Setting Error-Handling Options
       Setting Break on All Errors
       Setting Break in Class Modules
       Setting Break on Unhandled Errors

  2. Using the Err Object
       Properties of the Err Object
          Number Property
          Description Property
          Source Property
          HelpFile Property
          HelpContext Property
          LastDLLError Property
       Methods of the Err Object
       Using the vbObjectError Constant

  3. Handling Errors in Code
       Using the On Error Statement
       Inline Error Handling
       Error-Handling Routines
       Trappable Errors

  4. Using the Error-Handling Hierarchy

  5. Common Error-Handling Routines

  6. Using the Error Function

  7. Using the Error Statement

  8. Inline Error Handling



Get Started >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved