<%@ Language=VBScript %> <% Option Explicit %> <% Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.Provider = "MSDataShape" objConn.Open "DSN=University" Dim objClassRS, objProfessorRS, objProjectRS Dim strShapeSQL strShapeSQL = "SHAPE {SELECT ProfessorID, FirstName, LastName, PhoneNumber " & _ " FROM Professor}" & _ " APPEND({SELECT ClassName, RefNumber, ProfessorID FROM Class} AS Class " & _ " RELATE ProfessorID TO ProfessorID), " & _ " ({SELECT Title, ProfessorID FROM Project} AS Project " & _ " RELATE ProfessorID TO ProfessorID)" Set objProfessorRS = Server.CreateObject("ADODB.Recordset") objProfessorRS.Open strShapeSQL, objConn Do While Not objProfessorRS.EOF Response.Write "<BR>" Response.Write objProfessorRS("FirstName") & " " Response.Write objProfessorRS("LastName") & _ " (Phone: " & objProfessorRS("PhoneNumber") & ")<BR>" Response.Write "&nbsp;&nbsp;&nbsp;<B>Classes:</B><BR>" Set objClassRS = objProfessorRS("Class").Value Do While Not objClassRS.EOF Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;" & _ objClassRS("ClassName") & _ " (" & objClassRS("RefNumber") & ")<BR>" objClassRS.MoveNext Loop Response.Write "&nbsp;&nbsp;&nbsp;<B>Projects:</B><BR>" Set objProjectRS = objProfessorRS("Project").Value Do While Not objProjectRS.EOF Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;" & _ objProjectRS("Title") & "<BR>" objProjectRS.MoveNext Loop objProfessorRS.MoveNext Loop objProfessorRS.Close Set objProfessorRS = Nothing objConn.Close Set objConn = Nothing %>