VisData As a Sample

VisData was written as a test and sample of the data access features in Visual Basic. In the Professional and Enterprise editions, source code can be found in the Samples\VisData directory or wherever you installed Visual Basic. This sample is a good source of code and forms for your applications. Some of the forms were designed to be placed in other applications with very little modification.

This topic contains information that helps you use the VisData sample code to save you time in your application development. Modifying the code requires some experimentation and persistence on your part to make it work.

The best way to add a form to your application is to:

  1. Copy the .frm and .frx files to the same location as your application.

  2. Add the form you want to your application.

  3. Set the MDIChild property to False if your application is not MDI.

  4. Open the Code window and search the code for the word, "Standalone", for special instructions about using the form in your application.

  5. Make the changes and additions noted in the special instructions.

  6. Press F8 to compile your application.

  7. Fix any errors that occur on compilation. You may be required to add global variables, other forms or some of your own functionality. Usually you can simply comment out the code that is causing the error and then decide if you need it or not.

There are a number of useful routines in the modVisData code module that you might want to include in your application to make using the forms easier. Some of routines are called from a form and will either need to be added, commented out, or rewritten by you in order to make the form operate correctly.

If you do not add the VisData.bas file to your application, there are a few global variables you will need that are used to share data among the forms. They are listed in the "global variables" section of VisData.bas.

You can add the following forms to your application: