In today's class, we're going to learn about
ADO (ActiveX Data Objects) which is a different way of working with
recordsets - ADO is slightly different from DAO, and it has its
own uses. We'll talk about those uses in today's class.
We're also going to build a sample project, a Student Test Taker,
where we'll do lots more with recordsets, and we'll learn lots of new
techniques and functions.
We'll start by going over the available
References, and you'll see how to enable ADO (ActiveX Data Objects).
You'll learn how to create an ADO connection,
set the CursorType, LockType, and lots more.
We'll go over a lot of the same concepts as DAO
recordsets, such as looping through records, adding, editing, and
deleting records (and so on). You'll see how both are similar, but each
has its own pros and cons. One of the major benefits of ADO is that you
can connect to an SQL Server or Oracle Database with it:
Next we'll use our Recordset skills for a little
project: we'll build a student test taker (quiz) program. We'll
start out with a form/subform for the teacher to input questions and
correct answers.
Then we'll build a form where a user has to
log on and then take the test. All of his answers will be logged in
the database using a Recordset.
Then we'll build a nice report to summarize each
student's results.
Access 323 - Course Outline
1. ADO ActiveX Data Objects, Part 1
Benefits of ADO v. DAO
Create a Database Connection
CurrentProject.Connection
Provider
Recordset Types
- adOpenDynamic
- adOpenForwardOnly
- adOpenKeyset
- adOpenStatic
- adOpenUnspecified
Lock Types
- adLockReadOnly
- adLockPessimistic
- adLockOptimistic
2. ADO ActiveX Data Objects, Part 2
Loop Through Records (EOF)
Editing Records
Default is a READ ONLY Lock Type
AddNew to Add a New Record
Delete to Delete a Record
ADO Connection Strings
Connect to SQL Server
Connect to Oracle
Using Both ADO and DAO Together
3. Student Test Taker, Part 1
Question Table
Answer Table
Teacher Q/A Form
Student Table
Response Table
4. Student Test Taker, Part 2
Test Taker Form
Student Combo Box
Question Text Box
Answer List Box
Take Test Button
Disable the Student Combo
Disable the Test Button
Check to Make Sure Student Picked
Auto DropDown the Student Combo
DMin Function to Find Next QuestionID
Nz Function To Return Zero on Null
5. Student Test Taker, Part 3
Load List Box with Answers
RecordSet for Answers
List.AddItem
Button to Save Results
Save With RecordSet to ResponseT
Move To Next Question
Lock the Next Button When Test Done
6. Student Test Taker, Part 4
Query To Show All Student Answers
Different Links Give Different Results
How Multiple Relationships Interact
Report Grouped By Student
Grouping Options Button in Wizard
Summary Options Button
Calculate Student Average
Count of Records
Total Correct
Hiding the Detail Section
|