Creating Views with the View Designer

See Also

You can use the View Designer to create a view, which is a virtual table generated by a query. For example, a view might be designed to contain three out of five available columns in a table, created to limit access to certain information.

To create a view

  1. To start the View Designer, right-click the Views node in Data View, and then choose New View.

    The View Designer opens with a blank view with a temporary name.

Note   In Microsoft® Visual C++®, you can also create a new view using the New Database Item command on the Insert menu.

  1. Create the query you want to base the view on as you would create any query. Include all the search conditions information that will become part of your view.

    Note   Because a view is based on a Select query, you cannot change the query type. For details about creating the query, see Creating Queries.

  2. To save the view and assign it a name, choose Save <new view name> from the File menu. (In Microsoft Visual C++, choose the Save command.) In the Save New View dialog box, type the name for your view, following the naming conventions for your database.

    The new view is added to the list under the Views node in Data View.

If you are working with Microsoft® SQL Server™, you can encrypt a view, which prevents people from viewing or editing it.

To encrypt a view

Caution   After you encrypt a view and close it, you will not be able to open and edit it again.

  1. Open the view to encrypt.

    Note   In Microsoft Visual C++, open the view in design mode by right-clicking the view and selecting Design. If you open the view with the Open command, the property page will not display the encryption option.

  2. Right-click anywhere in the View Designer except on an input source window in the Diagram pane, and then choose Properties.

  3. Choose Encrypt view, and then choose OK.

The View Designer encrypts your view the next time you save it. You can continue to work with the view until you close the View Designer. After that, you will no longer be able to edit the view, although you will be able to use it as an input source.

Note   Microsoft SQL Server 7.0 supports the ORDER BY clause in Views, provided you use it with a TOP clause. You can use this feature by writing the SQL statement in the SQL Pane of View Designer.