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:
Copy the .frm and .frx files to the same location as your application.
Add the form you want to your application.
Set the MDIChild property to False if your application is not MDI.
Open the Code window and search the code for the word, "Standalone", for special instructions about using the form in your application.
Make the changes and additions noted in the special instructions.
Press F8 to compile your application.
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:
frmAttachments A form that displays a list of attached tables allowing the user to add new attachments and re-attach existing attachments. It requires a frmNewAttach to work correctly.
frmDataControl is a form that dynamically loads a recordset and displays the records.
frmDataGrid A form that displays a recordset in a bound grid with additional features such as quick sorting by clicking the column header.
frmDynaSnap A form that loads a dynaset or snapshot type recordset and provides many features such as searching for a form, zooming in on a memo field or large text fields, and the use of a scrollbar to move around the recordset. To use the functionality of frmDynaSnap, you must also have a frmFindForm and a frmZoom.
frmGroupsUsers A dialog box that allows you to administer the permissions of the groups and users of the database. It requires a frmNewPassword and frmNewUserGroup.
frmQuery A form that is a fairly full-featured query builder. It requires a frmJoin. The frmQuery may not be easy to create from VisData but using it may save you time and effort.
frmSQL A form that allows a user to enter SQL statements and execute them or save them as queries in the database.
frmTableObj A form that displays a table type recordset with features specific to a table recordset such as searching and setting the current index. It requires a frmSeek.