Visual Foxpro Databases: Objectives
Visual Foxpro Databases: Objectives
Visual FoxPro
Databases
Objectives
2-1
Understanding Database
Terminology
Visual FoxPro is a database development product that provides a powerful
language and flexible visual tools. The language and tools are designed to
make it easy to produce a database management application.
When you want to produce an application that manages data, you have to
start by creating structures to store your data. The structure that stores your
data affects how easily you can manipulate and present that data to the user.
This section discusses the tools in Visual FoxPro that you use to create the
structures where your data is stored. Table 1 defines a number of terms used
to talk about database design in Visual FoxPro. It is important to understand
the meaning of these terms as they apply to Visual FoxPro.
2-2
Term
Definition
Database
Table
Record
Field
Key
Index
2-3
Understanding Keys
One of the areas that can make or break a database application design effort
is the area of keys. It is easy to get caught up in the details of the
requirements, forgetting that you need a primary key for every table you
create.
2-4
2-5
When you have selected the database that best fits your needs, click Next to
continue.
2-6
2-7
Figure 3. Creating the indexes for the Tracks table in the Database Wizard.
Tip:
2-8
2-9
WARNING!
Step 5 Finish
Figure 6 shows the final step of the Database Wizard.
Step 5 Finish allows you to save the database. You can choose to save the
database and open it again in the Database Designer for further
customization. Additionally, you can have the wizard populate the tables
with a few sample records by selecting the Populate tables with sample data
check box.
We opted to open the database in the Database Designer. In the next section,
youll learn how to further modify the data.
2-10
2-11
There are two other ways to open the Database Designer. You can select the
File menu and choose NewDatabase, and click the New button. Or, you
can use commands in the Command window. The command Create
Database <DatabaseName> followed by the command Modify
Database opens the Database Designer.
2-12
There are three ways to access the functionality of the Database Designer. (1)
Clicking one of the buttons on the Database Designer toolbar (see Figure 8)
evokes the function described in the callouts. (2) These same operations are
available on the Database menu that is added to the Visual FoxPro System
menu whenever the Database Designer is open. (3) Right-clicking the
background of the Database Designer displays a shortcut menu with all the
options listed in Table 2.
Option
Action
Add Table
New Table
Creates a new view that gets its data from a remote source.
Modify Table
Connections
Creates a new view that gets its data from local tables.
Browse Table
Remove Table
Edit Stored
Procedures
2-13
2-14
Summary
Before you create a database, analyze and plan the type of database
you want to create.
2-15
2-16