Lab #20
FROM AUTHORS;
SELECT Publishers.*
FROM Publishers;
SELECT Authors.Author, Titles.Title, Titles.[Year Published], Titles.ISBN
FROM Authors INNER JOIN (Titles
INNER JOIN [Title Author] ON Titles.ISBN = [Title Author].ISBN) ON
Authors.Au_ID = [Title Author].Au_ID
WHERE
(((Authors.Author)="Cox, Joyce"))
ORDER BY Titles.Title;
SELECT Authors.Author
FROM
Authors;
SELECT
Authors.Author, [Title Author].ISBN, Titles.Title, Titles.[Year Published]
FROM
Titles INNER JOIN (Authors INNER JOIN [Title Author] ON Authors.Au_ID = [Title
Author].Au_ID) ON Titles.ISBN = [Title Author].ISBN
ORDER
BY Titles.Title;
SELECT
Publishers.Name, Publishers.Address, Publishers.City, Publishers.State,
Publishers.Zip, Publishers.Telephone, Publishers.Fax
FROM
Publishers
ORDER
BY Publishers.Name;
SELECT
Publishers.Name
FROM
Publishers;
SELECT
Publishers.Name, Titles.Title, Titles.[Year Published], Titles.ISBN
FROM
Publishers INNER JOIN Titles ON Publishers.PubID = Titles.PubID
ORDER
BY Titles.Title;
4. 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? THE PROCESS BEING DONE IS THAT REFRESH METHOD
GIVES CONTROL BACK TO ADO CONTROLS.
Sets the txtUserQuery.Text and Adodc1.Caption are
both set to Adodc1.RecordSource which is the text of the default query to be
displayed.
The second Subroutine is called when the Command Button is clicked. Yes, the arguments matter. The program needs to know what type of data it is bringing into memory.
Done
Seems to work virtually the same except for the column label to the left that remains fixed even when Grid is horizontally scrolled.
SELECT AUTHOR, AU_ID FROM AUTHORS ORDER BY AUTHOR
ASC
THE SYSTEM IS WAITING FOR THE RETRIEVE BUTTON, TO BE PRESSED.
There is no instructions for the selection event to produce any other actions. The command button “Retrieve Books” is programmed to take action upon the click event.
To ensure that the
program, reads the information as string constant to finish its query.
DataSource: AdoBooks
DataGrid1 displays Title,
Name, and Year Published.
3
There are 3 independent record sets. One each for DataCombo1, DataList1, and DataGrid1.