Lab 21

  1. The previous two labs have introduced the concept of a database—a piece of software that stores (maintains) data on a disk drive, and releases this data to a client as requested.   This description fits a file system as well except that for the simpler file system the user is expected to know the format of the data on the disk and its organization.   All the file system does is bring disk sectors into memory and allow the user to access the sector contents by keeping a file pointer for sequential access and calculating the access point for random access.   The file systems relieves the program of the buffer management so that the program can pretend that the whole file is in memory and any record can be accessed with simply a GET # or PUT #.   In contrast, the DBMS allows the program to pretend that all the data is organized into tables, and that new tables can be automatically generated via projection or inner join operations.   The DBMS accepts commands to generate such tables and returns to the program a set of records that satisfy the command.   The program does not have to know about buffering these records, or how they were generated, or how the data actually resides on the disk drive.   The transition of data from drive to program is taken care of by the DBMS and the program’s agent the ADO control.   The program generates the specification of the recordset, sets this specification in the ADO, and triggers the ADO to interact with the DBMS and refresh the local store of data.   Commands can then be issued to manipulate the local data.   Once the local data is processed, the ADO is instructed to returned it to the DBMS.    The ADO acts as the program’s buffer and other controls can be connected to this buffer to permit the program and the user to give instructions to the ADO concerning its records.   These processing controls, like the DataGrid , react to any changes made to the recordset.   Indeed, data aware controls can use data from multiple recordsets as illustrated in Figure 18.22 where a value is moved from one control to another and used to update a recordset.   The ADO is not the only control that can serve as a pipe from the DBMS to the program, the Data Environment Designer, illustrated in sections 18.10 is an alternative and more powerful control for this task.   It also makes a connection to the DBMS and retrieves a recordset, but it has more convenient commands for operating on the records.   Both permit the program to send SQL commands through the pipe to be executed by the DBMS.  Complete lab 20.

As a review of where we have come, fill in the following table which lists programs that we have studied and/or written, determining the purpose of the illustration and how well you feel you have absorbed the point and feel comfortable with the code:

Program

VB feature(s) illustrated for the first time

% mastered

Ex 5.16

 FOR/NEXT

 80

Ex 5.21

 FOR/NEXT

60 

Fig 6.19

 INT (X * RND( )), IMGDIE.PICTURE=LOAD, CASE

40 

Fig 6.24

 ENUM, SUM = , DON’T REALLY REMEMBER USING

 0

Ex 6.16

 FILLCHARACTER #

 40

Ex 6.39

 NOT THE FIRST TIME USED

85 

Fig 8.13

 ISNUMERIC, VAL, STR$

70 

EX 8.28

 FIRST TIME INTRODUCED, BUT NEVER USED

Fig 10.22

 LIST BOX

90 

Fig 10.41

 MSGBOX

80 

Fig 11.10

 MDI FORMS

85 

Fig 11.15

 MULTIPLE FORMS

80 

Fig 11.16

 MAIN, STARTUP

20 

Fig 12.3

 NOTHING NEW

80 

Fig 12.5

 FORM_MOUSE DOWN

75 

Fig 12.7

 SHIFT, ALT, CTRL

65 

Fig 12.13

 NOTHING NEW

65 

Fig 12.14

 KEY PREVIEW

70 

Fig 13.1

 DIVIDEBYZERO, ON ERROR GOTO

40 

Fig 13.5

 ERR

50 

Fig 13.7

 RESUME

60 

Fig 13.9

 STACK ERROR HANDLING

55 

Fig 13.10

 RETHROWING ERROR

70 

Fig 14.9

 FILESYSTEMOBJECT

60 

Fig 14.17

 TEXT STREAM, PATH,

40 

Fig 14.19

 TRIM$

60 

Fig 14.20

EXTRACTING, END OF SREAM  

 50

Fig 15.4

 TYPE, CLOSE, PUT

 55

Fig 15.5

 .TEXT =“”

60 

Fig 15.6

 STRING * 15, LENB(UDT)

50 

Fig 15.7

 GET

60 

Fig 18.15

 ADODC1

80 

Fig 18.20

 DATACOMBO DATALIST

80 

 

 

 

 

 

 

 

Program

VB feature(s) illustrated for the first time

% mastered

Ex 5.16

 For/Next Loop

85%

Ex 5.21

Nested For/Next Loops

85%

Fig 6.19

Select Case

100%

Fig 6.24

Enum

50%

Ex 6.16

No idea what is new and don’t remember how we did it.

0%

Ex 6.39

No idea what is new and don’t remember how we did it.

0%

Fig 8.13

IsNumeric, Val and Str$

75%

EX 8.28

Mid$, Right$, Left$ 

85%

Fig 10.22

ListBox

85%

Fig 10.41

Frames and MsgBox

85%

Fig 11.10

MDI

100%

Fig 11.15

Unload and Load

100%

Fig 11.16

Using Main in .bas as startup form

65%

Fig 12.3

MouseEvents

90%

Fig 12.5

Detecting Mouse Buttons

90%

Fig 12.7

Shift

90%

Fig 12.13

Key Events

85%

Fig 12.14

Key Preview

30%

Fig 13.1

Error handler

75%

Fig 13.5

Err object 

80%

Fig 13.7

Resume

85%

Fig 13.9

Call stack

50%

Fig 13.10

Rethrowing an error

75%

Fig 14.9

FSO

75%

Fig 14.17

Writing to a Sequential file

85%

Fig 14.19

Reading from a Sequential file

85%

Fig 14.20

Get file and open text stream for reading 

75%

Fig 15.4

Creating empty records

85%

Fig 15.5

Writing to a random access file

85%

Fig 15.6

Reading sequentially from Random Access File

80%

Fig 15.7

Random reading of a RAF

80% 

Fig 18.15

Querying Database

75%

Fig 18.20

DataCombo and DataList controls

80%

 

 

 

 

 

 

 

3.  Point your web browser at http://cbt.cs.ualr.edu.    Log on with the user name <two initials><last name> in caps (no password).   Click on the green Training button and then run the unit   Introduction to Data Access under Microsoft Visual Basic. 

Collapse Curriculum

View Curriculum Progress Report

Microsoft Visual Basic

 

 

View Course Progress Report

Microsoft Visual Basic 6.0 Desktop: Creating COM Components 1

 

 

View Course Progress Report

Microsoft Visual Basic 6.0 Desktop: Introduction to Data Access

 

 

View Course Progress Report

Microsoft Visual Basic 6.0 Desktop:

Summarize below how this material supplements the text presentation. I THINK THAT THE TRAING TURTORIALS SHOULD BE USED IN FILIMILRIZNG. I LIKE IT EVERY MUCH BECAUSE IT SEEMS TO GIVE A CLEAR UNDERSTANDING OF WHATS ACTUALLY BEING PRESTENTED IN THE TEXT.

Each module contains a small tutorial and then exercises to practice your newly learned information.  Also, the exercises include questions that are intended to help the user think about the ways that the information can be applied to programming needs.