Separate speaker notes to accompany Accesscode
This presentation covers two basic programs that establish the access to the table in the Access database through code written by the developer/programmer.
Microsoft ActiveX Data Objects 2.1 Library must be selected from the available references.
This shows the form I set up. I have highlighted the text box to hold the student idno. Note that the DataSource etc. have not been set.
When the program loads, this is the data that you see. This happens because the data is bound to the fields in the code.
This slide shows the results of the Find By Name which found Mary Stanton.
In this slide I have set up conStudent as ADODB.Connection and rsstudentrel00 as ADODB.Recordset. On the next slide, see the form load.
"Assigns an object reference to a variable or property
Set objectvar = [New] objectexpression
New is usually used during declaration to enable implicit object creation. When New is used with Set, it creates a new instance of the class. If objectvar contains a reference to an object, that reference is released when the new one is assigned. The New keyword can't be used to create new instances of any intrinisic data type and can't be used to create dependent objects." From Microsoft VB 6.0 Help
RIGHT JOIN allows records on the unmatched records in the second table.
Note that the Set statement establishes that the data source is rsstudentrel00.
The assign statement then puts a field fro the recordset into the text field using data field.
Depending on the option selected, I am setting up wkFind which I then use with the rsstudentrel00.Find.
This shows the navigation that is accomplished through the menu.
These are command navigation buttons. When clicked they perform the menu routines.
This shows the output from PrStudentGridCode.vbp. Note that there is information from the student table and from the major table - the connection is on majorcode.
Much of the code in this example is the same as the code in the previous example. The difference here is that I am establishing a grid for the data using a data grid.
Note that Data Source is not set in the properties. I am setting it in the code on the previous page.
Also note that I am using a Data Grid.