home *** CD-ROM | disk | FTP | other *** search
/ Using Visual Basic 5 (Platinum Edition) / vb5.iso / Code / ch39 / EditCourse.asp < prev    next >
Encoding:
Text File  |  1997-07-14  |  2.6 KB  |  89 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. SQL = "Select Category.* From Category"
  13.  
  14. Set RSCategory = Conn.Execute(SQL)
  15.  
  16. %>
  17.  
  18. <head>
  19. <title>Edit Course</title>
  20. </head>
  21. <body bgcolor="#FFFFFF">
  22. <h1>Edit Course</h1>
  23. <form action="SaveCourse.asp" method="POST" name="Edit Course">
  24.     <input type="hidden" name="Course_ID" value="<%=RSCourse("ID")%>">
  25.     <table border="0">
  26.         <tr>
  27.             <td><strong>Category:</strong></td>
  28.             <td><select name="Category" size="1">
  29. <%Do While Not RSCategory.EOF
  30.  
  31.     If RSCategory("ID") = RSCourse("Category") Then
  32. %>
  33.                 <option selected value="<%=RSCategory("ID")%>"><%=RSCategory("name")%></option>
  34. <%    Else%>
  35.                 <option value="<%=RSCategory("ID")%>"><%=RSCategory("name")%></option>
  36. <%    End If
  37.  
  38.     RSCategory.MoveNext
  39. Loop
  40. %>
  41.             </select></td>
  42.         </tr>
  43.         <tr>
  44.             <td><strong>Number:</strong></td>
  45.             <td><input type="text" size="5" name="Number"
  46.             value="<%=RSCourse("Number")%>"></td>
  47.         </tr>
  48.         <tr>
  49.             <td width="80"><strong>Title:</strong></td>
  50.             <td><input type="text" size="50" name="Title"
  51.             value="<%=RSCourse("Title")%>"></td>
  52.         </tr>
  53.         <tr>
  54.             <td valign="top"><strong>Description:</strong></td>
  55.             <td><textarea name="Description" rows="2"
  56.         cols="50"><%=RSCourse("Description")%></textarea></td>
  57.         </tr>
  58.         <tr>
  59.             <td valign="top"><strong>Audience:</strong></td>
  60.             <td><textarea name="Audience" rows="2"
  61.         cols="50"><%=RSCourse("Audience")%></textarea></td>
  62.         </tr>
  63.         <tr>
  64.             <td valign="top"><strong>Prerequisites:</strong></td>
  65.             <td><textarea name="Prerequisites" rows="2"
  66.         cols="50"><%=RSCourse("Prerequisites")%></textarea></td>
  67.         </tr>
  68.         <tr>
  69.             <td><strong>Cost:</strong></td>
  70.             <td><input type="text" size="20" name="Cost"
  71.             value="<%=RSCourse("Cost")%>"></td>
  72.         </tr>
  73.         <tr>
  74.             <td><strong>Duration:</strong></td>
  75.             <td><input type="text" size="20" name="Duration"
  76.             value="<%=RSCourse("Duration")%>"></td>
  77.         </tr>
  78.         <tr>
  79.             <td> </td>
  80.             <td><p align="right"><input type="submit"
  81.             name="Submit" value="Save"><input type="submit"
  82.             name="Submit" value="Delete"></p>
  83.             </td>
  84.         </tr>
  85.     </table>
  86. </form>
  87. </body>
  88. </html>
  89.