<%@ LANGUAGE = VBScript %> <% Option Explicit %> <% 'JAMES GJERDE 'RIVERKING TECHNOLOGIES TRIVIA PAGE 2003 On Error Resume Next Dim i Dim objConn Dim objCategoryRec Dim objSubCategoryRec Dim strCategoryArray Dim strSubCategoryArray 'strSubCategory needs to be url encoded because it gets appended to the query string Dim sqlCategory Dim sqlSubCategory Dim lastCategory Dim lastSubCategory i=0 sqlCategory="SELECT DISTINCT category FROM TERMS ORDER BY category" Set objConn = Server.CreateObject ("ADODB.Connection") Set objCategoryRec = Server.CreateObject ("ADODB.Recordset") Set objSubCategoryRec = Server.CreateObject ("ADODB.Recordset") objConn.Open "DSN=riverweb" If Err.Number=0 Then objCategoryRec.Open sqlCategory,objConn, 2, 1, 1 If Not objCategoryRec.EOF or Not objCategoryRec.BOF Then strCategoryArray=objCategoryRec.GetRows lastCategory=UBound(strCategoryArray, 2) 'now populate the strSubCategory array for the first category sqlSubCategory="SELECT DISTINCT subcategory FROM TERMS WHERE category='" & strCategoryArray(0,0) & "' ORDER BY subcategory" objSubCategoryRec.Open sqlSubCategory,objConn, 2, 1, 1 If Not objSubCategoryRec.EOF or Not objSubCategoryRec.BOF Then strSubCategoryArray=objSubCategoryRec.GetRows lastSubCategory=UBound(strSubCategoryArray, 2) End If End If End If %> Riverking Technologies <%If Err.Number<>0 Then %>

An error has occurred. The connection attempt failed.

Please contact the webmaster if you have any questions. Click here to return to the homepage.

<%Else%>
 

The trivia game requires the Flash 6 player, if you do not see the game after clicking a category, use your back button to come back to this page and get the Flash player below.

Choose a category from the list below.

 
<% 'for every other available subcategory within this category For i = 1 to lastSubCategory %> <% Next %> <% 'now if there are more categories do this again 'if lastCategory is greater than zero If lastCategory > 0 Then 'now we move the recordset objCategoryRec.MoveNext End If While Not objCategoryRec.EOF %> <% 'now repop the subcategory with the new category value objSubCategory.Close sqlSubCategory="SELECT DISTINCT subcategory FROM TERMS WHERE category='" & objCategoryRec("category") &"' ORDER BY subcategory" objSubCategoryRec.Open sqlSubCategory,objConn, 2, 1, 1 While Not objSubCategoryRec.EOF %> <% objSubCategoryRec.MoveNext WEnd ObjCategoryRec.MoveNext WEnd %>

<%= strCategoryArray(0,0)%>

<%= strSubCategoryArray(0,0)%>

<%= strSubCategoryArray(0,i)%>

<%= objCategoryRec("category")%>

"><%= objSubCategoryRec("subcategory") %>

 

HIGH SCORES

 
Copyright Riverking, Inc. 2002. All Rights Reserved.
<% objCategoryRec.Close objSubCategoryRec.Close objConn.Close Set objCategoryRec = Nothing Set objSubCategoryRec = Nothing Set objConn = Nothing End If %>