%@ Language=VBScript %>
<%
Response.Buffer = true
sortBy = FormatTextHTML(request.QueryString("sortBy"))
if sortBy = "" or sortBy = "title" then sortByField = "Q1"
if sortBy = "state" then sortByField = "State"
if sortBy = "fname" then sortByField = "FirstName"
strSQL = "SELECT * FROM ww_WritingMythFolkFair WHERE datalength(Q3) > 0 "
strSQL = strSQL & "and Status = 2 and WritingType='BIOG' order by " & sortByField
strQS = "comm=Y"
Connect_String="DSN=dotcom"
Page_Size = 5 'this is where you set the # of records displayed per page
If FormatTextHTML(request("Page")) = "" Then
Current_Page = 1
Else
Current_Page = CInt(FormatTextHTML(request("Page")))
End If
Set MyConn=Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
MyConn.Open Connect_String
rs.CursorLocation = 3
rs.PageSize = Page_Size
rs.Open strSQL, Connect_String,adOpenDynamic,3
Page_Count = rs.PageCount
If 1 > Current_Page Then Current_Page = 1
If Current_Page > Page_Count Then Current_Page = Page_Count
if rs.EOF or rs.BOF then
blnEmptyRs = true
else
blnEmptyRs = false
rs.AbsolutePage = Current_Page
end if
%>
Read Student Writing
<%
doMenu
%>
Read Student Writing
with Author's comments
<%
Response.Write "Page: " & Current_Page & " of " & Page_count & " "
If Page_Count > 1 then
' Response.Write " | "
for i = 1 to Page_count
if Current_Page = i then
Response.Write i & " | "
else
Response.Write "" & i & "" & " | " & vbCrLf
end if
next
If Current_Page < Page_Count Then
Response.Write "" & vbCrLf
Response.Write "Next"
End IF
End IF
Response.Write " "
%>
Click a column heading to sort by student name, state, or title.
Click a title to read the selection.