Sample Data
VB comes with the following two sample database files,
both in the Microsoft Access format:
- BIBLIO.MDB : Contains
database of computer book dealers and titles.
- NWIND.MDB : Contains
an imaginary company's complete database system,
including inventory, customers, vendors, employees,
marketing statistics, and more.
All access database files end in the extension .MDB
(for Microsoft database). Today's lesson uses the
supplied NWIND.MDB database to demonstrate some of
the data-related controls and commands.
The Data Control
When you want to access a database, the simplest
way to do so is to use the data control. The data
control is a control, which makes interaction with
database files easier. Several programmers think that
this control is slow and cumbersome tool for managing
data.
Add the data control to a form, you'll see that the
control looks like the one shown in following figure
Figure 23.1
The data control has these parts :
- The two inner arrows let you move forward and
backward through a database table one record at
a time.
- Outer arrows that move to the first and last records
in a database table.
- A middle area displays whatever information from
the database that you want to display.
The data control is bound control. You can bind many
VB controls, such as a text box control, to a database.
When a user moves through a database, the text box
displays the field you've set up.
|
When you bind a control to the
database, you don't have to worry about displaying
the field data, because VB does all the work. |
|