How to Use the Visual FoxPro Database Designer with VPM

Tip: The VPM Enterprise Data Builder should be your main tool for creating and modifying databases, tables and local views. The Data Builder is where a VPM Enterprise application looks for data dictionary data when it needs it.

The Visual FoxPro Database Designer is a great tool, and there is certainly a benefit in being able to design a database visually. However, the work you do in the Database Designer is not automatically saved in the VPM Enterprise Data Builder. Nevertheless, you can use the Database Designer if you follow the few, simple guidelines listed below.

Follow These Guidelines

If you want to use the Database Designer, follow these four guidelines:

·       Do It First: If you want to use the Visual FoxPro Database Designer to design and create a database, do it first. That is, don’t create the database in the Data Builder. Create it in the Database Designer. Then, add the database to the Data Builder using the Add button on the Databases pageframe.

·       Imported: When you add the database to the Data Builder, the Data Builder imports the database’s table structures, views, table indexes, table primary key designations and all field properties.

·       Not Imported: The Data Builder does not import items that are handled differently in VPM Enterprise. These items include table properties, referential integrity setup, table relations and table candidate key designations. Unless you plan on using the database outside your VPM Enterprise application, there is no need to set up table properties, referential integrity and candidate keys in the Database Designer. VPM Enterprise handles all these items in different (and we think better) ways through the Data Builder.

Tip: Although table relations are not imported, you may benefit from setting them in the Database Designer. When you set up the Data Environment in the Form or Report Designers, tables will be automatically related if you have set the relations in the Database Designer.

·       After a Database Is in the Data Builder, You Can: After you have created a database in or added a database to the Data Builder, here’s what you can do in the Database Designer:

·       Create or Add a Table or View: You can create a new table or view or add an existing table or view to the database. If you do, you must later add the table or view to the database in the Data Builder.

·       Remove a Table or View: You can remove a table or view from the database. If you do, you must later remove the table or view from the database in the Data Builder.

Tip: After a database is in the Data Builder, it’s usually easier to create new tables and views, add tables and views or remove tables and views through the Data Builder.

·       Set Table Relations: You can freely set table relations.

·       After a Database Is in the Data Builder, You Cannot: After you have created a database in or added a database to the Data Builder, here’s what you cannot and should not do in the Database Designer:

·       Do Not Change a Table’s Structure: Do not change a table’s structure in the Database Designer after the database is in the Data Builder.

·       Do Not Modify a Local View: Do not modify a local view in the Database Designer after the database is in the Data Builder.

·       After a Database Is in the Data Builder, You Can but We Recommend You Do Not: After a database is in the Data Builder, you can use the Database Designer to do the things listed below, but if you do, your work will not be automatically saved into the Data Builder. It is normally easier to do these things through the VPM Enterprise Data Builder anyway.

·       Create and Modify Indexes: Better to access the Table Designer via the Designer button on the List page in the Data Builder to create and modify indexes. Because the Data Builder uses the Visual FoxPro Table Designer for changing indexes, the changes you make through the Data Builder wind up in the DBC.

Tip: If you do create or modify indexes in the Database Designer, run the “Update Index Info” utility from the Edit page in the Data Builder. That utility will import index information changes into the Data Builder.

·       Primary key Designation: Better to access the Table Designer via the Designer button on the List page in the Data Builder to create or modify a primary key index. Because the Data Builder uses the Visual FoxPro Table Designer for changing indexes, the changes you make through the Data Builder wind up in the DBC.

·       Field Properties: Changes to field properties made through the Database Designer, Table Designer or View Designer after a database, table or view is in the Data Builder are not automatically imported into the Data Builder. Normally, you should and would want to set up field properties in the Data Builder.

Coordination between Data Builder and DBC

The Visual FoxPro Database Designer is a window into a Visual FoxPro Database Container (DBC). VPM Enterprise does not attempt to keep the Data Builder constantly in synch with DBC’s. The Data Builder replaces and extends much of the functionality that is contained in a DBC. The Data Builder allow users to use tools that you would otherwise access through the Database Designer, such as the VFP Database Designer, Table Designer and View Designer.

More:

Visual FoxPro Functionality that VPME Replaces