Week 1

In Review

In the first week, you learned about the relational database model, how to use the Visual Basic database objects to access and update existing databases, and how to use the Visual Data Manager (Visdata) program to create and maintain databases. You also learned how to design and code data entry forms, including use of the Visual Basic bound data controls, and how to create input validation routines at the keystroke, field, and form levels. Finally, you learned how to use the Visual Basic Crystal Reports Pro report writer to design simple reports, and you learned how to use the CRYSTAL.VBX control to run those reports from within your Visual Basic programs.

Day 1: Your First Database Program in Visual Basic 5

The first day's lesson gave you a crash course in how to build a fully functional data entry form in Visual Basic with minimal programming code. On Day 1, you learned the following:

Day 2: Creating Databases

The lesson on Day 2 concentrated on the fundamentals of relational databases. You learned the following about relational databases:

You also learned the 14 basic data field types recognized by Visual Basic 5. You constructed a data entry form that allows you to test the way Visual Basic behaves when attempting to store data entered into the various data field types.

Day 3: Visual Basic Database Objects

In Day 3's lesson, you learned that there are three main types of Visual Basic Recordset data objects:

You also learned about another data object--the Database object. You can use the Database object to get a list of tables in the database, a list of indexes associated with the tables, and a list of fields in each of the tables.

Day 4: Creating Data Entry Forms with Bound Controls

On Day 4, you learned about creating data entry forms with Visual Basic bound data controls.

You learned that the Visual Basic data control has five database-related properties. Three refer to the database and two refer to the Dynaset.

The Database properties of the Visual Basic data control are

The Dynaset properties of the Visual Basic data control are

You learned that the Visual Basic data control has three database-related methods:

You learned that the Visual Basic data control has three database-related events:

You learned how to use Visual Basic-bound form controls to link form input and display controls to data fields in the database.

You also learned several general rules for creating Visual Basic forms in the Windows 95 style:

Lastly, you learned how to write code that sets control colors to the Windows 95 default colors, how to create your own custom color scheme, and how to link your control colors to the color scheme selected with the Windows Control Panel color applet.

Day 5: Input Validation

On Day 5, you learned how to perform input validation on data entry forms. You learned that input validation tasks can be divided into three areas:

You also learned that you should ask yourself a few basic questions when you are developing validation rules for your form.

You learned how to write keyboard filter validation functions using the Visual Basic 5 KeyPress event. You learned how to write field-level validation functions that check for valid input ranges, input that is part of a list of valid data, and input that is within minimum and maximum length requirements. You also learned how to write validation functions that make sure dependent fields have been filled out properly.

Finally, you learned how to use Visual Basic 5 to create your own custom control that incorporates all the validation techniques you learned in this chapter. You can use this ActiveX control in all your future Visual Basic projects.

You also applied your knowledge of bound data controls, Visual Basic 5 data entry form design, and validation processing to create the data entry form for the CompanyMaster data table.

Day 6: Creating Reports with Crystal Reports Pro

On Day 6, you learned how to use Crystal Reports Pro to create a simple list report using the data tables you created earlier in the week. You also learned that Crystal Reports Pro is a banded report writer. These are the main bands in a report:

You also learned that Crystal Reports Pro recognizes three types of fields on the report form:

You also learned how to use the CRYSTAL.VBX control to run a report from within your Visual Basic program. Finally, you created a generic print report dialog that lets you control the report destination, file type, and number of copies.

Day 7: Using the Visdata Program

You wrapped up your first week of study by learning how to use the Visdata sample application to perform all the basic database operations needed to create and maintain databases for your Visual Basic 5 applications.

You learned how to:

You learned to use Visdata to perform database utility operations, including:

You learned to use Visdata to adjust various system settings that affect how Visual Basic 5 displays data tables and processes local and external database connections and parameters that control how Visual Basic 5 locks records at update time.