access parte 2

Page 244

Adding Objects to a SQL Server Database

Creating a View Creating a view is a lot like creating a classic Access query that selects a bunch of records. The following steps show you how to create a view and equip it with all the essentials, including sorting, filtering, and expressions: 1. Choose Create➝Queries➝Query Wizard. The New Query dialog box appears, which offers to help you create a variety of SQL Server query types. In this case, you simply want to create an ordinary query that extracts some useful data. 2. Choose Design View and then click OK. The Add Table dialog box appears. 3. Choose the table (or tables) you want to use, and then click Add to include it in your query. When you’re finished, click Close. The query designer appears. Conceptually, it works more or less like the Access query designer, with the same features. However, it looks a bit different (Figure 21-18). Figure 21-18:  When you add more than one table to a query, and these tables have a relationship defined in the database, the query designer includes the join lines (page 208). In this example, the query is showing a list of ordered items, with extra product information from the Products table.

4. Choose the fields you want to include in your query results. To include a field in your results, place a checkmark next to the field. Each field is added to the list at the bottom of the window in a separate row (Figure 21-19). This is similar to the Access query designer but flipped around. (Access creates one column for each field in a query.)

714

Access 2010: The Missing Manual


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.