You are on page 1of 4

User's Guide For:

VISUAL BASIC DATABASE PROJECTS


(c) 2001 KIDware

Manufactured and Distributed by:


KIDware
PO Box 28234
Seattle, WA 98118
(206) 721-2556
FAX (508) 464-0455
E-Mail: support@kidwaresoftware.com
Web Site: http://www.kidwaresoftware.com

INTRODUCTION
VISUAL BASIC DATABASE PROJECTS contains three programs you can use at home. The
programs illustrate advanced uses of Visual Basic with databases. Topics cover
ed include using the data access object (DAO), ActiveX data object (ADO), data b
ound controls, relational database design, graphics and printing. This free pro
duct has the actual Visual Basic source code for VISUAL BASIC DATABASE PROJECTS
that you can study and modify, as you desire. You should be able to understand
this code if you have completed our VISUAL BASIC AND DATABASE course. Check our
website for all of our tutorials.
The programs included with VISUAL BASIC DATABASE PROJECTS are: WEIGHT MONITOR,
a program allowing you to monitor your daily weight and compute your body mass i
ndex (BMI), STUDENT IDENTIFICATION, a program allowing entering information (inc
luding picture) on school students and printing identification cards, and PIZZA
ORDERS, a order/customer tracking system. We hope you have fun and learn from e
ach of these programs.

PROGRAM OPERATION INSTRUCTIONS


The files included with VISUAL BASIC DATABASE PROJECTS are in a single zip file.
The files are:
WEIGHT MONITOR:
weight.vbp - project file
weight.vbw - project workspace file
weight.frm - form file
weight.frx - form graphics file
weight.ico - project icon
template.mdb - project template database
sample.mdb - project sample database
STUDENT IDENTIFCATION:
student.vbp - project file
student.vbw - project workspace file
student.frm - input form file
student.frx - input form graphics file
student.bas - code module
preview.frm - preview form file
student.mdb - student database
/StudentPhotos/ - folder containing photos
PIZZA ORDERS
pizza.vbp - project file
pizza.vbw - project workspace file
pizza.frm - input form file
pizza.frx - input form graphics file
pizza.bas - code module
pizza.ini - configuration file
newcustomer.frm - preview form file
denpizza.den - data environment
pizzadb.mdb - pizza database

vbproj.doc - Word version of this readme file


To install on your machine, unzip the file to the desired folder. Then, in the
Visual Basic environment, just load and run the VISUAL BASIC DATABASE PROJECTS
project file for the desired project. The source code for the projects require
Visual Basic 6. Running instructions for the three projects follow.

WEIGHT MONITOR
This program lets you monitor your weight daily. It also provides a body mass i
ndex (BMI) calculator.
The WEIGHT MONITOR form has three tabs: 'Record Weight Data', 'View Weight Data
' and 'Body Mass Index'. The first tab allows you to enter a daily weight value
and any comment in the displayed grid. A calendar control aids in choosing dat
es. Each file contains one year of data. You may start a new file by choosing
a year and clicking 'New File'. Previously saved files may be opened by choosin
g 'Open File'. Clicking 'Exit' ends the program. The 'View Weight Data' tab al
lows you to view a line graph of any one month's data (choose the month via the
option buttons). A printout of the displayed graph is obtained by clicking 'Pri
nt Data'. The last tab, 'Body Mass Index', computes a number (based on height a
nd weight) that is used to evaluate your health. Use the two arrow controls to
establish weight and height values. Your body mass index (BMI), along with a si
mple evaluation, is displayed. The computations can be done in US or metric uni
ts.
Visual Basic Skills:
This program demonstrates uses of the data access object (DAO) data control, the
common dialog box, the tabbed dialog control, the calendar control, the chart c
ontrol, the grid control, data manipulation and printing techniques.
Potential Problem:
When you try to load this example, you may receive an error message that says GR
ID32.OCX or MSCHART.OCX missing. If you get this message, you need to do a litt
le work to install the desired DAO data grid and chart controls (and other DAO-b
ased controls, if desired) onto your computer. The steps are many, but the effo
rt is worth it, especially if you ever plan to use or build applications that em
ploy DAO database technology. The information provided here was taken from Micr
osoft's website. You will need your installation CD for Visual Basic 6. You wi
ll also have to be familiar with issuing DOS command line statements. Ask for h
elp from someone if this is unfamiliar.
Look in the \COMMON\TOOLS\VB\CONTROLS directory on the VB6 CD. This directory c
ontains controls that shipped with Visual Basic 4/5 Professional and Enterprise
Editions, which are no longer shipping with Visual Basic 6:
AniBtn32.ocx, Gauge32.ocx, Grid32.ocx, KeySta32.ocx, MSOutl32.ocx, Spin32.ocx, T
hreed32.ocx, MSChart.ocx
To install these files on your computer, follow these steps:
1. Copy all of the files in this directory to your \WINDOWS\SYSTEM directory.
2. Register the controls by either Browsing to them in Visual Basic itself (sele
ct the Browse option when selecting Components), or manually register them using
RegSvr32.Exe. RegSvr32.EXE can be found in the \COMMON\TOOLS\VB\REGUTILS direc
tory. The DOS command line for grid32.ocx is:
regsvr32.exe grid32.ocx
For mschart.ocx, use:
regsvr32.exe mschart.ocx
3. Register the design time licenses for the controls. To do this, merge the vb
ctrls.reg file found in the \COMMON\TOOLS\VB\CONTROLS directory into your regist
ry. You can merge this file into your registry using RegEdit.Exe (Win95, Win98,
WinMe, Win2000 or WinNT4) or RegEd32.Exe (WinNT3.51):
regedit vbctrls.reg (or other reg files associated with the controls)
The DAO files (including the DAO data grid and chart control) should now appear
in the Components listing when choosing controls to add to your toolbox.

STUDENT IDENTIFICATION
This program accepts information on students for a hypothetical school (includin
g a photo) allowing previewing of student identification cards. It can be modif
ied for any purpose requiring similar identification.
The input form asks for first name, last name, sex (male or female), birth date,
grade and photo. Choose Edit to change information, then Save or Cancel. Choo
se New Student to enter information for a new student, Delete Student to remove
displayed record, or ID Preview to see the resulting identification card. Exit
ends the program. The photos to be used must be saved in a folder named /Studen
tPhotos/ stored within the application folder.
Visual Basic Skills:
This program demonstrates use of the ActiveX data object (ADO) data control, var
ious controls, use of photos in databases, and many database management tasks (e
dit, new, delete, save, cancel).

PIZZA ORDERS
This program simulates the taking of orders at a pizza takeout restaurant. It c
an be used as a template for any retail type business.
The order form finds customers by phone number. You enter a phone number and cl
ick 'Find Customer'. If the customer is in the database (our example has a few
customers - use the Data Manager to find the phone numbers), their information a
ppears and ordering begins. If the customer is not found, a form appears to all
ow entering customer information. To order a pizza, choose from the listed opti
ons and click 'Build Pizza'. Add as many pizzas to the order as you desire, the
n click 'Order Complete'. A printed receipt is then available.
When you try to run the program, if you get an error message saying the PizzaDB
database cannot be found, you need to reset the connection string property of th
e data environment.
Visual Basic Skills:
In this program, the use of the ADO data environment, printing using the Printer
object, and data storage techniques are illustrated.

You might also like