Bagikan melalui


Database Wizard

The Database wizard uses predefined templates to help you create a database containing appropriate tables.

The following templates are included in Visual FoxPro.

**Note   **You can use the Application wizard to create an application that uses these templates.

Template Description
Address Book Includes a table for a personal address book.
Asset Tracking Includes tables useful in documenting assets and costs.
Books Includes tables useful in documenting authors and books.
Contact Includes tables useful in documenting and managing contacts.
Donation Includes tables useful in managing donation campaigns.
Event Management Includes tables useful in planning and managing events and personnel.
Expenses Includes tables useful in documenting employee expenses and reporting.
Household Inventory Includes tables useful in managing household furniture and equipment.
Inventory Control Includes tables useful in tracking inventory.
Ledger Includes tables useful in managing transactions.
Membership Includes tables useful in managing club or other membership groups.
Music Collection Includes tables useful in managing recordings collections.
Order Entry Includes tables useful in managing order entry operations.
Picture Library Includes tables useful in managing collections of film and photographs.
Recipes Includes tables useful in managing household recipes.
Resource Scheduling Includes tables useful in specifying, scheduling, and managing resources.
Service Call Management Includes tables useful in managing service call jobs and personnel.
Students and Classes Includes tables useful in managing students, teachers, facilities, and educational programs.
Time and Billing Includes tables useful in managing client and employee accounts.
Video Collection Includes tables useful in managing collections of videotapes.
Wine List Includes tables useful in managing wine collections.
Workout Includes tables useful in planning and managing a physical fitness program.

To access the Database wizard

  1. Open Visual FoxPro.
  2. From the Tools menu, choose Wizards, and click Database.

Step 1 – Select a Database

In this step, you can select a Visual FoxPro database template from the list in the Select database section. For more information about each of these templates, see the previous table. Alternatively, you can specify Visual FoxPro database or select an Access (.mdb) database template by clicking the Select button. This displays the Open dialog box from which you then locate the remote database to use as a template.

Step 2 – Select Tables and Views

In this step, you can choose the tables and views you want to include in your database. The template you specified in Step 1 provides a list of pre-selected tables and views. Select the check boxes for the tables or views you want to use in your database.

Step 3 – Index the Tables

In this step, you can determine how you want to index your tables. You can select which field you want to use as the primary index key.

To specify a field as primary index key

  1. In the Select table list box, highlight the table containing the field you want to use.
  2. In the Primary key list box, highlight the field you want to use.

You also can select check boxes beside the options offered in the Field Name section to create additional indexes.

Step 4 – Set up Relationships

In this step, you can establish or change the relationships between the tables in the database.

To specify a relationship between tables in your database

  1. In the Select table list box, highlight the table containing the field you want to use.
  2. In the My new X table list box (with X being the name of the table), highlight the relationship statement you want to edit, and then click the Relationships… button.
  3. In the Relationships dialog box, click the radio button next to the description of the type of relationship you want to create. You can select the key field or create a new field by typing in the edit box.
  4. Click OK. This returns you to Step 4 where the new or edited relationship is listed in the My new X table list box.

Step 5 – Finish

In this step, you select the final options for your database:

Save database for later use — Saves your database.

Save database and modify it in the Database Designer — Saves your database and opens it in the Database designer for further modification.

Populate tables with sample data — populates the new database with the sample data in the template.

After the wizard generates the database, you can add the database to a Project Manager window or to the Component Gallery, or you can open the Database designer to modify the database tables and relationships.

See Also

Wizards Overview | Project Manager Window | Starting with the Component Gallery | Database Designer