Creating Views

The basic process for creating a view is generally the same regardless of the method you use and is similar to the way you create queries. For information about creating queries, see Creating Queries.

Note    The tables you use must be part of a project or database before you can use the View Wizard or View Designer to create a view.

The following process generally describes how to create a view.

To create a view

  1. Determine whether you need to create a local or remote view.
  2. Specify the tables from which you want to include data in the view and specify their join conditions.
  3. Select the fields in the tables that you want to retrieve data from and specify any additional criteria for retrieving records from those tables.
  4. Specify whether to send changes to the original or base tables that the view was built from.
  5. Generate the view.

When you create a view you want to save, give it a name. Visual FoxPro adds a definition of the view to the current database. The view definition contains the table names, selected fields, and property settings for the view.

When you use the view, Visual FoxPro builds and runs a SQL statement that defines the data set for the view using the view definition. For information about view properties, see Displaying the Structure of a View, DBGETPROP( ) Function, or CURSORGETPROP( ) Function.

You can create two types of views, local and remote views. For more information, see Creating Local Views and Accessing Remote Data with Views. You can also create views from multiple tables. For more information, see Creating a Multitable View.

See Also

Working with Views | Combining Views | Customizing Views | Modifying, Renaming, and Deleting Views | Displaying Data with Views | Manipulating Offline Data | Optimizing View Performance