Creating Tables

If you need to create a new table, you can and should create it through the Data Builder. You can choose to either:

∑       Create a new table from scratch, or

∑       Create a new table by copying an existing tableís structure, indexes and Data Builder entries.

ō To create a new table

1.   On the List page in the Data Builder select Free Tables or the Tables node under the name of the database in which you want to create the table.

2.   Click the New button. VPM Enterprise displays the New Table dialog.

3.   Table Name and Path: Click the ellipsis (Ö) button in the Select New Table Location and Enter Name box. VPM Enterprise displays the Save As dialog with your projectís \DATA directory selected.

   Enter the new table name in the New Table box. Click Save to confirm the table name and path and to return to the New Table dialog.

Tip: Normally, you create new tables in your projectís \DATA directory to keep your projectís data files together. However, you can choose a different directory on the Save As dialog if you need to do so.

4.   If you want to create the new table by copying an existing table, go to step 6 below. Otherwise, click the OK button on the New Table dialog and go to step 5.

5.   Table Designer: VPM Enterprise displays the Visual FoxPro Table Designer. Use the Table Designer to enter the fields in the table. You can create the tableís indexes at this time as well ó see Creating Indexes for Tables.

                                       Visual FoxPro Table Designer

Tip: If you need help using the Visual FoxPro Table Designer, select FoxPro Help on the VPM Enterprise Help menu.

   Complete the entry of your tableís fields and properties. Click OK to close the Table Designer. As you return to the Data Builder, VPM Enterprise will automatically create a DELETED() index tag for your table - see Required Indexes for Tables. Thatís it. Youíre done.

Table Designer Field Properties: While you can enter Field Properties in the VFP Table Designer, you donít need to do that. You can and should enter the field properties in the Data Builder. We recommend that you set up field validation in the Data Builder instead of in the Table Designer. The Data Builder provides predefined field validation rules that make setting up field validation easier (see Setting Up Field Validation).

Tip: If you need to use the Visual FoxPro Field Properties outside your VPME application, you should enter them in the Table Designer. Any Field Properties you enter in the Table Designer when you create a table are imported into the VPME Data Builder from the Table Designer.

6.   Copy Table: If you choose to create a new table by copying an existing table, click the ellipsis (Ö) button in the Select Table to be Copied box on the New Table dialog. VPM Enterprise displays the Open dialog with your projectís \DATA directory selected.

   Find the table you want to copy. Click Select to confirm your table selection and to return to the New Table dialog.

   If you want to copy the records in the table as well as the table structure, click the Copy Records check box.

   Click OK. VPM Enterprise creates the new table and itís indexes by copying the structure and indexes of the table you chose to copy. If you also chose to copy records, the new table will contain the records in the table you chose to copy.

Tip: If the table you choose to copy is in the current projectís Data Builder, the tableís Data Builder entries (Table and Field properties) will be copied to the Data Builder records of the new table.


Modifying Tables