%@ Language=VBScript %>
<%
Session.LCID = 2064
On Error Resume Next
strSQL = Session(strTableName & "SQL")
if Len(strSQL)<3 then strSQL = gstrSQL
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Open
Set rsDetails = server.CreateObject ("ADODB.Recordset")
rsDetails.Open strSQL, dbConnection
if NOT rsDetails.EOF then
mypage = Request.Form("mypage")
rsDetails.PageSize = Request.Form("pagesize")
maxRecords = cdbl(rsDetails.RecordCount)
maxPages=cdbl(rsDetails.PageCount)
if cdbl(mypage) > cdbl(maxPages) then
mypage = maxpages
End IF
rsDetails.AbsolutePage = mypage
maxrecs=cdbl(rsDetails.pagesize)
End IF
Response.Write "
")
rsDetails.Close
Set rsDetails = Nothing
' display table with results
sub loopRs(rs, nPageSize)
if nPageSize=0 then nPageSize=PageSize
' Pagination:
dim iShadeTheDetail, iNumberOfRows, nColumns
nColumns = 0
iNumberOfRows = 0
if isObject(rs) then
' Pagination: UNTIL iNumberOfRows>=maxrecs
DO UNTIL rs.eof OR iNumberOfRows>=nPageSize
' To insure that every other one is shaded
If iShadeTheDetail = 0 then
sShadeClass = "class=shade"
iShadeTheDetail = 1
Else
sShadeClass = ""
iShadeTheDetail = 0
End If
%>
>
<%
iNumberOfRows = iNumberOfRows + 1
rs.movenext
Loop
end if
end sub
sub WriteTableHeader
%>
<%
%>
<%
end sub
Function GetTotal(value, stype, iNumberOfRows, sFormat)
if sFormat = FORMAT_CURRENCY and value<>"" then
value = FormatCurrency(value)
elseif sFormat = FORMAT_NUMBER and value<>"" then
value = FormatNumber(CDbl(value), 2)
end if
if stype="COUNT" then GetTotal= "Count: " & CStr(iNumberOfRows)
if stype="TOTAL" then GetTotal = "Total: " & CStr(value)
if stype="AVERAGE" then GetTotal="Average: " & CStr(CDbl(value)/iNumberOfRows)
End Function
%>