Lab #20
- We
have looked at one SQL query, All Titles, in Access. Which of the keywords from Fig 18.13
were used?
- Exercise
18.4 on p. 806 lists several “reports” that the author suggests that you
could program as a query following the example of All Titles. Write the required SQL statement for
each here.
- Test
each of your SQL statements in Access (type the query into the SQL view
screen and report on the result of the run)
- Recall
that the result of a query is a recordset in a work area of memory
that can be further massaged by the control that owns it. The recordset object has a current
setting (a record pointer) and a variety of properties about the set as
well as objects associated with the fields of the records. Like the Seek command, the Recordset
object can “positioned” at a particular record by using the Bookmark
attribute. The Recordset object
can initialize a Fields object that
provides access to properties of the contents of the argument named for
the current record (see p. 801). The
recordset thus is manipulated much like an array in memory except that it
is nonhomogenous and it can be drastically changed by successive (chained)
operations. The technique that
the author illustrates is the extraction of a recordset from a database and
then the use of a control to perform manipulations on it. Fig 18.15 is the first such example
requiring more than setting the ADO and DataGrid properties to “channel”
the data. Fig 18.14 lists some
Ado properties that emphasizes the ADO’s role in coordinating between the
program and the database via the Recordset. Notice that the ADO has little to do with either display or
interpretation of the Recordset—other controls accomplish that (like the
DataGrid). The RecordSource
property tells the ADO the criteria for the Recordset extraction. The program in Fig 18.15 loads a value
into this property and then calls the refresh method that causes the ADO
to return to the database and extract the records meeting the criteria,
reinitializing the Recordset object.
When this happens, other controls, such as the DataGrid, that are bound
to the recordset are also “refreshed”.
The first program action is to load the form. What happens here?
- When
is the second Subroutine called (note that it has only one statement in
its body)? Do the
Adodc1_MoveComplete arguments matter?
- Make
this program run on your machine and supplicate the picture on p. 787.
- The
FlexGrid Control example operates just as the DataGrid did. Install it as instructed in Fig. 18.17
and execute the program and compare to the other control.
- The
next example uses three controls that are data aware. The first, the DataCombo, is initialized to read “Select an
Author” and the user is invited to type or select from the list that drops
down. Where does this list come
from?
- When
the user selects an author’s name. Nothing happens. Why?
- Why
the single quotes in line 28 and lines 35?
- Where
does the list in the listbox come from?
- What
happens when you click on any entry in the listbox?
- set up
and run Fig 18.20 by following the property specification in Fig 18.21.
How many independent recordset objects are there in this application?