JJ titleview View

HOI authors

M

f11 (AD Columns)

Uj

aujd

I I

¡name

;au fname

_| phone

V

M if :ea

¡¿title ■ type •/ PLlbJa

a

HOI titieauthor

□11 (All Columns)

au tt

□ litte kt

v au ol d

royalty per

Column

Alias

Table

Output

Sort Type

Sort Order

title

titles

Vi.

au ord

titieauthor

au Iname

authors

price

titles

Í|

vtd_sales

titles

y/

pubjd

titles

V

SELtCT dbo. titles, fitie, dbo. titieauthor. au_ord. dbo.auihors.aujnarine. dbo. titles,price, dbo. tit! FROM dbo. authors INNER JOIN

dbo. titieauthor ON dbo. authors, auja = dbo. titieauthor. au_id INNER JOIN dbo.titles ON dbo.titieauthor.title id = dbo. titles, titie id

Figure 9.21

To view all three portions of the display shown in Figure 9.21, you must first enable the Diagram, Grid, and SQL statement icons on the toolbar.

After a view has been created, you can reference it in all the places where you could otherwise use a table. For example, you could have an ADO recordset that is based on a SQL statement such as the following:

SELECT * FROM titleview

The previous SQL statement causes the SQL behind the view (as shown in Figure 9.21) to run and to return the various columns selected. The view of Figure 9.21 will be similar to the screen shown in Figure 9.22 if opened in view mode from within Access.

J tiileview : View

a S)Q

title

au ord

au Iname

price

ytd_sales | pubjd

*

>

This Busy Executive's Date

1

Eennet

S19.99

409s 1389

Fifty Years in Buckingham

1

Elotchet-Halls

$11 95

15096 0077

—j

But Is It User Friendly?

1

Carson

S22.95

8780 1389

The Gourmet [Microwave

1

DeFrance

Î2.99

22246 0877

Silicon Valley Gastronomii

1

del Castillo

S19.99

2032 0877

Secrets of Silicon Valley

1

Dull

Î20.00

4095 1389

The Busy Executives Datf

2

Green

Î19.99

4095 1389

You Can Combat Compute

1

Green

$2.99

18722-0736

Sushi Anyone?

3

Gringlesby

S14.

4095 0877

V

Record: H | 1 | »1 M..) of 25

Í

.jui ]

Figure 9.22

0 0

Post a comment