<% Set objDC = Server.CreateObject("ADODB.Connection") strConn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/fpdb/Champions.mdb") objDC.Open strConn Set objRS = objDC.Execute("Select Distinct Sport FROM Results") %>

MAC Sportsmanship Winners by Sport and Year

Back to Search

Choose a Sport

<% ' Close Data Access Objects and free DB variables objRS.Close Set objRS = Nothing objDC.Close Set objDC = Nothing %> <% 'Some code to hide the second drop down until we make a selection from the first IF Request.Form("Sport") = "" Then Else 'If School has a value then we get a list of cities for the second drop down Set objDC = Server.CreateObject("ADODB.Connection") strConn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/fpdb/Champions.mdb") objDC.Open strConn Set objRS = objDC.Execute("Select Distinct Year FROM Results WHERE Sport = '" & Request.Form("Sport") & "'") %>
">

Choose a Year

<% ' Close Data Access Objects and free DB variables objRS.Close Set objRS = Nothing objDC.Close Set objDC = Nothing End IF %>
 

Sportsmanship Winners For Your Choice:
<% 'Make sure we have submitted a Sport and don't show results until we do IF Request.Form("Sport") = "" Then Else Set objDC = Server.CreateObject("ADODB.Connection") strConn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/fpdb/Champions.mdb") objDC.Open strConn Set objRS = objDC.Execute("Select * FROM Results WHERE Sport = '" & Request.Form("Sport") & "' AND Year = '" & Request.Form("Year") & "'AND Type = '"&("Sportsmanship")&"' ORDER BY Rank ASC") 'Loop through the database and assign the appropriate values to variables 'that we will use later Do Until objRS.EOF Yr = objRS("Year") School = objRS("School") Sport = objRS("Sport") Division = objRS("Division") 'Set up the display of the record Response.Write Yr & " - " & School & " - " & Sport & " - " & Division & "
" objRS.MoveNext Loop objRS.Close Set objRS = Nothing objDC.Close Set objDC = Nothing %> <% End IF %>