Presentation is loading. Please wait.

Presentation is loading. Please wait.

Please use speaker notes for additional information!

Similar presentations


Presentation on theme: "Please use speaker notes for additional information!"— Presentation transcript:

1 Please use speaker notes for additional information!
Shape Try Examples Please use speaker notes for additional information! This slide presentation has some experiments with the shape language.

2 PrStuHier.vbp (Try2) This is try 2 - it accomplishes the same thing that the previous sample does but the connection is internal.

3 With flxStuHier PrStuHier.vbp (Try2) Set .DataSource = rsStudent00
.RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColHeaderCaption(0, 1) = "Stu ID#" .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 2) = "Name" .ColWidth(2, 0) = 1800 .ColHeaderCaption(0, 3) = "City" .ColHeader(1) = flexColHeaderOn .ColWidth(4, 0) = 0 .ColHeaderCaption(1, 0) = "Maj Cd" .ColWidth(0, 1) = 600 .ColHeaderCaption(1, 1) = "Major Name" .ColWidth(1, 1) = 1800 .ColHeaderCaption(1, 2) = "Major Advisor" .ColWidth(2, 1) = 1800 .ColHeader(2) = flexColHeaderOn .ColWidth(0, 2) = 0 .ColHeaderCaption(2, 1) = "Course Cd" .ColHeaderCaption(2, 2) = "Sem. Taken" .ColHeaderCaption(2, 3) = "Grade" End With The set up of the hierarchy flex grid is done internally. The band information is not available on the property pages because of this. Compare the code and property pages to the example in the slide show that introduced the shape language. This code is at the bottom of Form_Load.

4 PrStuHier.vbp (Try2) As you can see, the text boxes are not bound to the data through the properties.

5 Dim comStuHier As ADODB.Connection Dim rsStudent00 As ADODB.Recordset
Dim StuCoursesInfo As ADODB.Recordset Dim MajorInfo As ADODB.Recordset Dim msgstr As String Private Sub Form_Load() Dim DBPath As String DBPath = App.Path If Right(DBPath, 1) <> "\" Then DBPath = DBPath & "\" End If DBPath = DBPath & "studentrel00.mdb" Set comStuHier = New ADODB.Connection With comStuHier .ConnectionString = "Provider = MSDataShape;" & _ "Data Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Persist Security Info=False;" & _ "Data Source=" & DBPath .Open End With The Form_Load has a connection string that includes the MSDataShape as Provider. This is required when the shape language is used to establish the recordset.

6 Set rsStudent00 = New ADODB.Recordset
Dim SQLCmd As String SQLCmd = "SHAPE {SELECT * FROM student00} AS Student00 " & _ "APPEND ({SELECT * FROM major00} AS Major00 " & _ "RELATE 'majorcode' TO 'majorcode') AS Major00, " & _ "({SELECT * FROM stucourse00} AS StuCourses00 " & _ "RELATE 'studentidno' TO 'studentidno') AS StuCourses00" SQLCmd = "SHAPE {SELECT studentidno, name, city, majorcode FROM student00} AS Student00 " & _ "APPEND ({SELECT majorcode, majorname, advisor FROM major00} AS Major00 " & _ With rsStudent00 .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText End With Set MajorInfo = rsStudent00.Fields("Major00").Value Set StuCoursesInfo = rsStudent00.Fields("StuCourses00").Value Set txtstudentidno.DataSource = rsStudent00 Set txtname.DataSource = rsStudent00 Set txtmajorcode.DataSource = rsStudent00 Set txtmajorname.DataSource = MajorInfo With dgdCourses Set .DataSource = StuCoursesInfo .Columns(0).Caption = "Stu ID #" .Columns(1).Caption = "Crs Cd" .Columns(2).Caption = "Semester" .Columns(3).Caption = "Grade" .Refresh Rsstudent00 is now opened with SQLCmd which is text. MajorInfo is the rsStudent00 fields dealing with Major00. This is where txtmajorname comes from. The SHAPE language is used to SELECT the major data source and then APPEND and RELATE the rest of the data. In this case the student has both the major and the stucourses related to it. There are two versions of the SHAPE, one using all of the fields from student00 and one taking just four fields from student00. Since both shape commands are assigned to SQLCmd, the second one is the one that is executed. This is the information from StuCoursesInfo. It is put into a data grid.

7 PrStuHier.vbp (Try3) In Try3, the hierarchy flex grid is also shown on a second form. Therefore the bas module is used for the connection and the recordset.

8 PrStuHier.vbp (Try3) Private Sub cmdSeeForm_Click() Me.Hide
frmStuHierInd.Show End Sub Private Sub Form_Load() With flxStuHierX Set .DataSource = rsStudent00 .RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColHeaderCaption(0, 1) = "Stu ID#" .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 2) = "Name" .ColWidth(2, 0) = 1800 .ColHeaderCaption(0, 3) = "City" .ColHeader(1) = flexColHeaderOn .ColWidth(4, 0) = 0 .ColHeaderCaption(1, 0) = "Maj Cd" .ColWidth(0, 1) = 600 .ColHeaderCaption(1, 1) = "Major Name" .ColWidth(1, 1) = 1800 .ColHeaderCaption(1, 2) = "Major Advisor" .ColWidth(2, 1) = 1800 .ColHeader(2) = flexColHeaderOn .ColWidth(0, 2) = 0 .ColHeaderCaption(2, 1) = "Course Cd" .ColHeaderCaption(2, 2) = "Sem. Taken" .ColHeaderCaption(2, 3) = "Grade" End With Private Sub Form_Unload(Cancel As Integer) This shows the code used in the form that shows only the grid. The recordset used was public in the module and is therefore available to this form.

9 PrStuHier.vbp (Try7) This shows the output which is by course and includes information about the student and their major and their courses.

10 PrStuHier.vbp (Try7) This shows the data environment and the resulting shape language statement that resulted. The Data Environment can be used to develop the code and then you can select it and use Ctrl+C to copy and paste it into your VB code and on the notepad to save etc. This statement puts the coursecode at the beginning and then shows students with their major and student courses.

11 PrStuHier.vbp (Try7) The first command in the connection is course where all of the courses information is taken and the data is being ordered by coursecd.

12 PrStuHier.vbp (Try7) The problem that was confronted is that one student can take the same course twice so we set up a special link which selects DISTINCT coursecd and studentidno from student00 and puts it in order by coursecd and studentidno. The things beneath at the next level will relate to this link and thereby to either coursecd or studentidno.

13 PrStuHier.vbp (Try7) This shows the link of Students to CrsStuLnk based on studentidno.

14 PrStuHier.vbp (Try7) As you can see major is under students and relates directly to student. The relationship is based on majorcode.

15 PrStuHier.vbp (Try7) The stuCrsData is linked to the CrsStuLnk based on both the coursecd and the studentidno.

16 PrStuHier.vbp (Try7) Note the bands that correspond to the data environment.

17 PrStuHier.vbp (Try7) Private Sub Form_Load() With MSHFlexGrid1
.RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 1) = "Crs Cd" .ColWidth(2, 0) = 2500 .ColHeaderCaption(0, 2) = "Course" .ColWidth(3, 0) = 650 .ColHeaderCaption(0, 3) = "Credits" .ColWidth(0, 1) = 0 .ColWidth(1, 1) = 0 .ColHeaderCaption(2, 0) = "Stu ID#" .ColWidth(1, 2) = 1800 .ColHeaderCaption(2, 1) = "Student Name" .ColWidth(2, 2) = 650 .ColHeaderCaption(2, 2) = "Maj Cd" .ColWidth(0, 3) = 0 .ColWidth(1, 3) = 1800 .ColHeaderCaption(3, 1) = "Major" .ColWidth(2, 3) = 1800 .ColHeaderCaption(3, 2) = "Advisor" .ColHeader(4) = flexColHeaderOn .ColWidth(0, 4) = 0 .ColWidth(1, 4) = 0 .ColHeaderCaption(4, 2) = "Sem Taken" .ColHeaderCaption(4, 3) = "Grade" End With End Sub This shows the Form_Load for try 7 which establishes the flex grid.

18 PrStuHier.vbp (Try8) This shows two of the three forms (the third form is similar to the second) and the information contained in the bas module. Note that there is a public connection of conStuHier in the bas module.

19 PrStuHier.vbp (Try8) This is the output on the first form. The grid lists the information by student. Then the major information is shown and finally the course information.

20 DIM the recordsets that will contain the needed information.
Dim rsStudent00 As ADODB.Recordset Dim StuCoursesInfo As ADODB.Recordset Dim MajorInfo As ADODB.Recordset PrStuHier.vbp (Try8) DIM the recordsets that will contain the needed information. Private Sub Form_Load() Dim DBPath As String DBPath = App.Path If Right(DBPath, 1) <> "\" Then DBPath = DBPath & "\" End If DBPath = DBPath & "studentrel00.mdb" Set comStuHier = New ADODB.Connection With comStuHier .ConnectionString = "Provider = MSDataShape;" & _ "Data Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Persist Security Info=False;" & _ "Data Source=" & DBPath .Open End With Set rsStudent00 = New ADODB.Recordset Dim SQLCmd As String SQLCmd = "SHAPE {SELECT studentidno, name, city, majorcode FROM student00} AS Student00 " & _ "APPEND ({SELECT majorcode, majorname, advisor FROM major00} AS Major00 " & _ "RELATE 'majorcode' TO 'majorcode') AS Major00, " & _ "({SELECT * FROM stucourse00} AS StuCourses00 " & _ "RELATE 'studentidno' TO 'studentidno') AS StuCourses00" With rsStudent00 .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText Set up the connection string with MSDataShape because the shape language is being used. The shape command can be developed in the Data Environment and then brought over here. In this example the student information is first and is related to both the major information and the student information. Prior to open on the rsStudent00, the cursor location, cursor type and lock type are specified. The resordset is opened using the shape command in SQLCmd.

21 Note that there was an End Sub at the bottom that does not fit.
Set MajorInfo = rsStudent00.Fields("Major00").Value Set StuCoursesInfo = rsStudent00.Fields("StuCourses00").Value Set txtstudentidno.DataSource = rsStudent00 Set txtname.DataSource = rsStudent00 Set txtmajorcode.DataSource = rsStudent00 Set txtmajorname.DataSource = MajorInfo With dgdCourses Set .DataSource = StuCoursesInfo .Columns(0).Caption = "Stu ID #" .Columns(1).Caption = "Crs Cd" .Columns(2).Caption = "Semester" .Columns(3).Caption = "Grade" .Refresh End With With flxStuHier Set .DataSource = rsStudent00 .RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColHeaderCaption(0, 1) = "Stu ID#" .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 2) = "Name" .ColWidth(2, 0) = 1800 .ColHeaderCaption(0, 3) = "City" .ColHeader(1) = flexColHeaderOn .ColWidth(4, 0) = 0 .ColHeaderCaption(1, 0) = "Maj Cd" .ColWidth(0, 1) = 600 .ColHeaderCaption(1, 1) = "Major Name" .ColWidth(1, 1) = 1800 .ColHeaderCaption(1, 2) = "Major Advisor" .ColWidth(2, 1) = 1800 .ColHeader(2) = flexColHeaderOn .ColWidth(0, 2) = 0 .ColHeaderCaption(2, 1) = "Course Cd" .ColHeaderCaption(2, 2) = "Sem. Taken" .ColHeaderCaption(2, 3) = "Grade" PrStuHier.vbp (Try8) MajorInfo and StuCoursesInfo are set with information from the rsStudent00 with the fields on the appropriate table. This allow the developer to get the information needed for the text boxes and the data grid. Now MajorInfo and StuCourses Infor are set, the columns on the grid are captioned and the data source is established. Finally the columns on the hierarchy flex grid are set and the data source is established. Note the use of the bands. Note that there was an End Sub at the bottom that does not fit.

22 PrStuHier.vbp (Try8) On this form, the information is by major. The major is shown followed by the students in that major followed by the courses they have taken.

23 Option Explicit Dim rsStudent00 As ADODB.Recordset PrStuHier.vbp (Try8) Private Sub Form_Load() Set rsStudent00 = New ADODB.Recordset Dim SQLCmd As String SQLCmd = "SHAPE {SELECT * FROM major00 ORDER BY majorname} AS Major00 " & _ "APPEND ((SHAPE {SELECT studentidno, name, city, majorcode FROM student00} AS Student00 " & _ "APPEND ({SELECT * FROM stucourse00 ORDER BY studentidno, coursecd} AS StuCourses00 " & _ "RELATE 'studentidno' TO 'studentidno') AS StuCourses00) AS Student00 " & _ "RELATE 'majorcode' TO 'majorcode') AS Student00 " With rsStudent00 .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText End With With flxStuHier Set .DataSource = rsStudent00 .RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColHeaderCaption(0, 1) = "Maj Cd" .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 2) = "Major Name" .ColWidth(2, 0) = 2200 .ColHeaderCaption(0, 3) = "Major Advisor" .ColWidth(3, 0) = 1800 .ColHeader(1) = flexColHeaderOn .ColHeaderCaption(1, 0) = "Stu ID" .ColWidth(0, 1) = 900 .ColHeaderCaption(1, 1) = "Student Name" .ColWidth(1, 1) = 1800 .ColHeaderCaption(1, 2) = "City" .ColWidth(2, 1) = 1800 .ColWidth(3, 1) = 0 .ColHeader(2) = flexColHeaderOn .ColWidth(0, 2) = 0 .ColHeaderCaption(2, 1) = "Course Cd" .ColHeaderCaption(2, 2) = "Sem. Taken" .ColHeaderCaption(2, 3) = "Grade" End Sub This shows the shape state for the by major listing on the previous page.

24 PrStuHier.vbp (Try8) This shows the information by course which is connected to student and major and then to when the student took the course.

25 Option Explicit Dim rsStudent00 As ADODB.Recordset PrStuHier.vbp (Try8) Private Sub Form_Load() Set rsStudent00 = New ADODB.Recordset Dim SQLCmd As String SQLCmd = "SHAPE {SELECT course00.* FROM course00 ORDER BY coursecd} AS Courses " & _ "APPEND (( SHAPE {SELECT DISTINCT coursecd, studentidno FROM stucourse00 ORDER BY coursecd, studentidno} AS CrsStuLnk " & _ "APPEND (( SHAPE {SELECT studentidno, name, majorcode FROM student00 ORDER BY studentidno} AS Students " & _ "APPEND ({SELECT major00.* FROM major00} AS Majors " & _ "RELATE 'majorcode' TO 'majorcode') AS Majors) AS Students " & _ "RELATE 'studentidno' TO 'studentidno') AS Students, " & _ "({SELECT stucourse00.* FROM stucourse00 ORDER BY coursecd, studentidno, grade} AS StuCrsData " & _ "RELATE 'coursecd' TO 'coursecd','studentidno' TO 'studentidno') AS StuCrsData) AS CrsStuLnk " & _ "RELATE 'coursecd' TO 'coursecd') AS CrsStuLnk" With rsStudent00 .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText End With With flxStuHierY Set .DataSource = rsStudent00 .RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 1) = "Crs Cd" .ColWidth(2, 0) = 2500 .ColHeaderCaption(0, 2) = "Course" .ColWidth(3, 0) = 650 .ColHeaderCaption(0, 3) = "Credits" .ColWidth(0, 1) = 0 .ColWidth(1, 1) = 0 .ColHeaderCaption(2, 0) = "Stu ID#" .ColWidth(1, 2) = 1800 .ColHeaderCaption(2, 1) = "Student Name" .ColWidth(2, 2) = 650 .ColHeaderCaption(2, 2) = "Maj Cd" .ColWidth(0, 3) = 0 .ColWidth(1, 3) = 1800 .ColHeaderCaption(3, 1) = "Major" .ColWidth(2, 3) = 1800 .ColHeaderCaption(3, 2) = "Advisor" .ColHeader(4) = flexColHeaderOn .ColWidth(0, 4) = 0 .ColWidth(1, 4) = 0 .ColHeaderCaption(4, 2) = "Sem Taken" .ColHeaderCaption(4, 3) = "Grade" End Sub This shows the connection by course. It follows the logic developed in the data environment in try7.

26 PrStuHier.vbp (Try9) Version 9 produces the same results as version 8. There are minor differences in the code. For example, bout the connection and the recordset are defined in the bas module.

27 PrStuHier.vbp (Try9) Dim StuCoursesInfo As ADODB.Recordset
Dim MajorInfo As ADODB.Recordset Dim rsStu00BkMrk As Variant Dim SQLCmd As String Private Sub Form_Load() Dim DBPath As String DBPath = App.Path If Right(DBPath, 1) <> "\" Then DBPath = DBPath & "\" End If DBPath = DBPath & "studentrel00.mdb" Set comStuHier = New ADODB.Connection With comStuHier .ConnectionString = "Provider = MSDataShape;" & _ "Data Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Persist Security Info=False;" & _ "Data Source=" & DBPath .Open End With Set rsStudent00 = New ADODB.Recordset SQLCmd = "SHAPE {SELECT studentidno, name, city, majorcode FROM student00} AS Student00 " & _ "APPEND ({SELECT majorcode, majorname, advisor FROM major00} AS Major00 " & _ "RELATE 'majorcode' TO 'majorcode') AS Major00, " & _ "({SELECT * FROM stucourse00} AS StuCourses00 " & _ "RELATE 'studentidno' TO 'studentidno') AS StuCourses00" End Sub This shows the code for the main form where there are the text boxes, the regular grid and the hierarchy flex grid. See examples in try 8. The two recordsets that will contain information for the text boxes and the data grid have a dim statement here. The connection string is established using the public connection from the bas module and the rsstudent00 is set (note there was also a public declaration in the bas module). The shape language is used to put together the hierarchy by student.

28 PrStuHier.vbp (Try9) Private Sub Form_Activate()
'This routine is executed each time the form is activated. The Form_Load routine 'is executed only when the form is loaded into memory. With rsStudent00 If .State = adStateOpen Then .Close End If .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText If Not IsEmpty(rsStu00BkMrk) Then .Bookmark = rsStu00BkMrk End With Set MajorInfo = rsStudent00.Fields("Major00").Value Set StuCoursesInfo = rsStudent00.Fields("StuCourses00").Value Set txtstudentidno.DataSource = rsStudent00 Set txtname.DataSource = rsStudent00 Set txtmajorcode.DataSource = rsStudent00 Set txtmajorname.DataSource = MajorInfo With dgdCourses Set .DataSource = StuCoursesInfo .Columns(0).Caption = "Stu ID #" .Columns(1).Caption = "Crs Cd" .Columns(2).Caption = "Semester" .Columns(3).Caption = "Grade" .Refresh Whenever this form is activated, the code shown is executed. The check on state makes sure that the student is not already open prior to executing the open statement. If it is open, it is closed.

29 PrStuHier.vbp (Try9) With flxStuHier Set .DataSource = rsStudent00
.RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColHeaderCaption(0, 1) = "Stu ID#" .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 2) = "Name" .ColWidth(2, 0) = 1800 .ColHeaderCaption(0, 3) = "City" .ColHeader(1) = flexColHeaderOn .ColWidth(4, 0) = 0 .ColHeaderCaption(1, 0) = "Maj Cd" .ColWidth(0, 1) = 600 .ColHeaderCaption(1, 1) = "Major Name" .ColWidth(1, 1) = 1800 .ColHeaderCaption(1, 2) = "Major Advisor" .ColWidth(2, 1) = 1800 .ColHeader(2) = flexColHeaderOn .ColWidth(0, 2) = 0 .ColHeaderCaption(2, 1) = "Course Cd" .ColHeaderCaption(2, 2) = "Sem. Taken" .ColHeaderCaption(2, 3) = "Grade" End With End Sub PrStuHier.vbp (Try9) This shows the code to handle the hierarchy flex grid and the bookmarks. Private Sub cmdShwGrdX_Click() Me.Hide rsStu00BkMrk = rsStudent00.Bookmark rsStudent00.Close frmStuHierX.Show End Sub Private Sub cmdShwGrdY_Click() frmStuHierY.Show

30 Private Sub Form_Activate()
With rsStudent00 If .State = adStateOpen Then .Close End If .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText End With With flxStuHier Set .DataSource = rsStudent00 .RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColHeaderCaption(0, 1) = "Maj Cd" .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 2) = "Major Name" .ColWidth(2, 0) = 2200 .ColHeaderCaption(0, 3) = "Major Advisor" .ColWidth(3, 0) = 1800 .ColHeader(1) = flexColHeaderOn .ColHeaderCaption(1, 0) = "Stu ID" .ColWidth(0, 1) = 900 .ColHeaderCaption(1, 1) = "Student Name" .ColWidth(1, 1) = 1800 .ColHeaderCaption(1, 2) = "City" .ColWidth(2, 1) = 1800 .ColWidth(3, 1) = 0 .ColHeader(2) = flexColHeaderOn .ColWidth(0, 2) = 0 .ColHeaderCaption(2, 1) = "Course Cd" .ColHeaderCaption(2, 2) = "Sem. Taken" .ColHeaderCaption(2, 3) = "Grade" End Sub Private Sub Form_Load() SQLCmd = "SHAPE {SELECT * FROM major00 ORDER BY majorname} AS Major00 " & _ "APPEND ((SHAPE {SELECT studentidno, name, city, majorcode FROM student00} AS Student00 " & _ "APPEND ({SELECT * FROM stucourse00 ORDER BY studentidno, coursecd} AS StuCourses00 " & _ "RELATE 'studentidno' TO 'studentidno') AS StuCourses00) AS Student00 " & _ "RELATE 'majorcode' TO 'majorcode') AS Student00 “ PrStuHier.vbp (Try9) This shows the form load and form activate for the hierarchy flex grid that will show the data by major. Note that the shape command is used once when the form is loaded. Each time the form is activated the information is opened and used.

31 PrStuHier.vbp (Try9) Private Sub Form_Activate() With rsStudent00 If .State = adStateOpen Then .Close End If .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQLCmd, comStuHier, , , adCmdText End With With flxStuHierY Set .DataSource = rsStudent00 .RowHeight(0) = 0 .ColHeader(0) = flexColHeaderOn .ColWidth(1, 0) = 650 .ColHeaderCaption(0, 1) = "Crs Cd" .ColWidth(2, 0) = 2500 .ColHeaderCaption(0, 2) = "Course" .ColWidth(3, 0) = 650 .ColHeaderCaption(0, 3) = "Credits" .ColWidth(0, 1) = 0 .ColWidth(1, 1) = 0 .ColHeaderCaption(2, 0) = "Stu ID#" .ColWidth(1, 2) = 1800 .ColHeaderCaption(2, 1) = "Student Name" .ColWidth(2, 2) = 650 .ColHeaderCaption(2, 2) = "Maj Cd" .ColWidth(0, 3) = 0 .ColWidth(1, 3) = 1800 .ColHeaderCaption(3, 1) = "Major" .ColWidth(2, 3) = 1800 .ColHeaderCaption(3, 2) = "Advisor" .ColHeader(4) = flexColHeaderOn .ColWidth(0, 4) = 0 .ColWidth(1, 4) = 0 .ColHeaderCaption(4, 2) = "Sem Taken" .ColHeaderCaption(4, 3) = "Grade" End Sub This shows the form activate for the by course hierarchy flex grid.

32 PrStuHier.vbp (Try9) Private Sub Form_Load() SQLCmd = "SHAPE {SELECT course00.* FROM course00 ORDER BY coursecd} AS Courses " & _ "APPEND (( SHAPE {SELECT DISTINCT coursecd, studentidno FROM stucourse00 ORDER BY coursecd, studentidno} AS CrsStuLnk " & _ "APPEND (( SHAPE {SELECT studentidno, name, majorcode FROM student00 ORDER BY studentidno} AS Students " & _ "APPEND ({SELECT major00.* FROM major00} AS Majors " & _ "RELATE 'majorcode' TO 'majorcode') AS Majors) AS Students " & _ "RELATE 'studentidno' TO 'studentidno') AS Students, " & _ "({SELECT stucourse00.* FROM stucourse00 ORDER BY coursecd, studentidno, grade} AS StuCrsData " & _ "RELATE 'coursecd' TO 'coursecd','studentidno' TO 'studentidno') AS StuCrsData) AS CrsStuLnk " & _ "RELATE 'coursecd' TO 'coursecd') AS CrsStuLnk" End Sub This shows the form load for the by course that was first examined in try 7.


Download ppt "Please use speaker notes for additional information!"

Similar presentations


Ads by Google