<% ' Fetch records Set rs = conDB.Execute(sSQL) With rs ' Move record pointer if possible If iRecsToSkip > 0 And iRecsToSkip <= iQuestionCount Then .Move iRecsToSkip Else iCurrentPage = 1 iRecstToSkip = 0 End If iIndexTag = iRecsToSkip+1 If iPageSize = 0 Then While Not .EOF sCategory = UCase(.Fields("Category")&"") If sCategory <> sOldCategory Then If bCloseQuote Then Response.Write "" %><%=.Fields("Category")%>
<% End If%>

"> <%=HighLight(.Fields("Question"))%>

<% sOldCategory = sCategory bCloseQuote = True .MoveNext iIndexTag = iIndexTag + 1 Wend If bCloseQuote Then Response.Write "
" Else For i=1 To iPageSize If Not .EOF Then sCategory = UCase(.Fields("Category")&"") If sCategory <> sOldCategory Then If bCloseQuote Then Response.Write "" %><%=.Fields("Category")%>
<% End If%>

"> <%=HighLight(.Fields("Question"))%>

<% .MoveNext iIndexTag = iIndexTag + 1 sOldCategory = sCategory bCloseQuote = True Else Exit For End If Next If bCloseQuote Then Response.Write "
" If iCurrentPage > 1 Then %><%=smPrev%> <% End If If Not ((iQuestionCount / iPageSize < iCurrentPage And iQuestionCount Mod iPageSize > 0) Or (iQuestionCount / iPageSize = iCurrentPage And iQuestionCount Mod iPageSize = 0)) Then %> | <%=smNext%><% End If End If End With %>