%@ 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 %>
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%>