Condividi tramite


Creating Views

Because views and queries have much in common, your steps in creating a view are similar to the steps you take in creating a query. You choose the tables and fields you want to include in the view, specify the join conditions used to relate the tables, and specify filters to select specific records. Unlike in queries, in views you also can select how the changes you make to the data in a view are sent to the original, or base tables, from which the view is built.

When you create a view, Microsoft® Visual FoxPro® stores a view definition in the current database. The definition contains the names of the tables used in the view and selected fields and the settings for their properties. When you use the view, the view definition is used to build a SQL statement that defines the view's data set.

For information about view properties, see Displaying the Structure of a View, DBGETPROP( ) or CURSORGETPROP( ).

You can create two types of views: local and remote. Remote views use remote SQL syntax to select information from tables on a remote ODBC data source. Local views use Visual FoxPro SQL syntax to select information from tables or views. You can add one or more remote views into a local view, making it possible for you to access information from Visual FoxPro and remote ODBC data sources in the same view.

In This Section

  • Creating a Local View
    You can create a local view with the View designer or the CREATE SQL VIEW command.
  • Creating a Multitable View
    To access related information that is stored in separate tables, you can create a view and add two or more tables, or you can modify an existing view by adding tables.
  • Modifying, Renaming, and Deleting Views
    You can modify existing views in the View designer using the Project Manager or the language.
  • Accessing Remote Data
    When you want to use data located on a remote server, you create a remote view.
  • Displaying Data with Views
    Describes how views are used and explains how to use a view both programmatically and through the interface.
  • Manipulating Offline Data
    Offers conceptual information on using the Microsoft® Visual FoxPro® offline view features to change, collect, and display data outside of the host database.
  • Optimizing View Performance
    Presents instructions on how to set performance and data fetching options.
  • Creating Queries
    Use queries to create and work with simple read-only queries based on tables (.dbf files) or views. Use views to access and update records from multiple tables, as well as update local and remote data.
  • Running Queries
    Provides instructions on how to run a query, choose a query destination, see the SQL statement for your query, and add a comment to a query.
  • Querying Multiple Tables and Views
    Explains the process of querying more than one table or view and provides steps on how to add a table or view to a query.