Adding Tables

If you have existing tables that you have created in Visual FoxPro, you can add them to the Data Builder. Normally, you will add the tables in an existing database to the Data Builder when you add the database to the Data Builder. See Adding a Database. However, you could add individual tables to the Data Builder if:

·       The tables are free tables, or

·       You created the tables through the Database Designer after you had already added the database to the Data Builder.

Here are a few rules you have to observe when you add tables:

·       DBC Not in Data Builder: If the table you want to add to the Data Builder is in a Visual FoxPro database that is not in the Data Builder, you must add the DBC to the Data Builder, which will add the table as well.

·       DBC in Data Builder: If the table is in a database that has already been added to the Data Builder, you can only add the table to that database.

·       Free Table: If the table is a free table, you can add the table to the Data Builder as a Free Table or you can add it to a database. If you add the free table to a database in the Data Builder, the Data Builder will convert the free table to a table in the database.

Tip: If the table you need to add are outside the current project’s directories and if you will be packaging the application for installation on another computer, you should copy or move the table(s) to the project’s \DATA directory before adding.

Ř To add existing tables to the Data Builder

1.   On the List page in the Data Builder select Free Tables or the Tables node under the name of the database that contains the table that you want to add. Use the rules listed above to make your selection.

2.   Click Add on the Data Builder List page. VPM Enterprise displays the Add Tables dialog.

    

   The Add dialog lets you move among your computer’s drives and directories to find the tables you want to add. 

3.   Use the Drive and Directory popups on the Add dialog to select the drive and directory that contain the tables you want to add. VPM Enterprise displays the table names in the directory in the Tables list at the top of the Add dialog.

4.   The Add dialog only displays files with a .DBF extension unless you select the All Files check box. If you want to see all the files in a directory, select the All Files check box.

5.   When you find a table to add, highlight it and click the Select button or double-click the table name. The table’s path and name will appear in the Selected list at the bottom of the Add dialog.

6.   If you want to add all the tables in the directory, click the Select All button. VPM Enterprise will display the path and names of all the tables in the directory in the Selected list at the bottom of the Add dialog.

7.   If you want to remove a table from the Selected list, highlight the table and click the Remove button or just double-click the table. Click the Remove All button to remove all tables from the Selected list.

8.   When all the tables you want to add are displayed on the Selected list, click OK. VPM Enterprise displays a dialog asking you to confirm that you want to add the tables to the Data Builder. Click Yes to let VPM Enterprise Add the tables to the Data Builder.

9.   After the tables are added to the Data Builder, the Location box on the table’s Edit page shows the location of the table if it is outside the FoxPro path.

Tip: After you add a table to the Data Builder, be sure to set up table and field properties for the table as well as the required indexes — see Required Indexes for Tables.

Table Data Imported from a DBC

Imported: When you add a DBC table to the Data Builder, the Data Builder imports the table structure, table indexes, table primary key designation and all field properties.

Not Imported: The Data Builder does not import items that are handled differently in VPME. Such items include table properties and table candidate key designations. Unless you plan on using the table outside your VPM Enterprise application, there is no need to set up table properties and candidate keys in the Table Designer.

More:

Removing Tables