home *** CD-ROM | disk | FTP | other *** search
/ Using Visual Basic 5 (Platinum Edition) / vb5.iso / Code / ch39 / courses.asp < prev    next >
Encoding:
Text File  |  1997-07-14  |  2.1 KB  |  97 lines

  1. <html>
  2. <%
  3.  
  4. Set Conn = Server.CreateObject("ADODB.Connection")
  5.  
  6. Conn.Open "DSN=LocalTraining"
  7.  
  8. SQL = "Select Course.* From Course Where Course.ID=" & Request.QueryString("ID")
  9.  
  10. Set RSCourse = Conn.Execute(SQL)
  11.  
  12. %>
  13. <head>
  14. <title><%=RSCourse("Title")%></title>
  15. </head>
  16.  
  17. <body bgcolor="#FFFFFF">
  18.  
  19. <p>
  20.     <font color="#FF0000" size="4" face="Verdana">
  21.         <strong><%=RSCourse("Number")%></strong>
  22.     </font>
  23.     <font color="#000000" size="4" face="Verdana">
  24.         <strong><%=RSCourse("Title")%></strong>
  25.     </font>
  26. </p>
  27.  
  28. <p><%=RSCourse("Description")%></p>
  29.  
  30. <p><strong>Audience:</strong><%=" " & RSCourse("Audience")%></p>
  31.  
  32. <p><strong>Prerequisites:</strong><%=" " & RSCourse("Prerequisites")%></p>
  33.  
  34. <p><strong>Duration:</strong><%=" " & RSCourse("Duration")%></p>
  35.  
  36. <%
  37. RSCourse.Close
  38.  
  39. SQL = "Select Schedule.*,Instructor.Last_Name & ', ' & Instructor.First_Name as InstrName, "
  40. SQL = SQL & "Location.Name as LocName From Schedule,Instructor,Location "
  41. SQL = SQL & "Where (Schedule.Start_Date > Now) AND (Schedule.Course_ID=" & Request.QueryString("ID") & ") AND " 
  42. SQL = SQL & "(Schedule.Location = Location.ID) AND (Schedule.Instructor = Instructor.ID) "
  43. SQL = SQL & "ORDER BY Schedule.Start_Date"
  44. Set RSDates = Conn.Execute(SQL)
  45.  
  46. If RSDates.EOF Then
  47. %>
  48.  
  49. <p>No Scheduled dates for this course. Contact
  50.     <a href="mailto:training@online-can.com">
  51.         <strong>Online</strong>
  52.     </a>
  53. for more information. </p>
  54.  
  55. <%Else%>
  56.  
  57. <table border="0" width="100%">
  58.     <tr>
  59.         <td width="20%"><strong>Date</strong></td>
  60.         <td width="30%"><strong>Location</strong></td>
  61.         <td width="50%"><strong>Instructor</strong></td>
  62.     </tr>
  63. </table>
  64.  
  65. <table border="2" width="100%">
  66. <%
  67.  
  68. Do While Not RSDates.EOF
  69.  
  70. %>
  71.     <tr>
  72.         <td width="20%">
  73.         <a href="registration.asp?id=<%=RSDates("Schedule_ID")%>">
  74.             <%=RSDates("Start_Date")%>
  75.         </a>
  76.       </td>
  77.         <td width="30%"><%=RSDates("LocName")%></td>
  78.         <td width="50%"><%=RSDates("InstrName")%></td>
  79.     </tr>
  80.  
  81. <%
  82.     RSDates.MoveNext
  83.  
  84. Loop
  85.  
  86. RSDates.Close
  87.  
  88. End If
  89.  
  90. %>
  91.  
  92.  
  93.  
  94.  
  95. </body>
  96. </html>
  97.