%@LANGUAGE="VBSCRIPT"%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim kdcjcx_total
Dim kdcjcx_first
Dim kdcjcx_last
' set the record count
' set the number of rows displayed on this page
If (kdcjcx_numRows < 0) Then
kdcjcx_numRows = kdcjcx_total
Elseif (kdcjcx_numRows = 0) Then
kdcjcx_numRows = 1
End If
' set the first and last displayed record
kdcjcx_first = 1
kdcjcx_last = kdcjcx_first + kdcjcx_numRows - 1
' if we have the correct record count, check the other stats
If (kdcjcx_total <> -1) Then
If (kdcjcx_first > kdcjcx_total) Then
kdcjcx_first = kdcjcx_total
End If
If (kdcjcx_last > kdcjcx_total) Then
kdcjcx_last = kdcjcx_total
End If
If (kdcjcx_numRows > kdcjcx_total) Then
kdcjcx_numRows = kdcjcx_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (kdcjcx_total = -1) Then
' count the total records by iterating through the recordset
kdcjcx_total=0
While (Not kdcjcx.EOF)
kdcjcx_total = kdcjcx_total + 1
kdcjcx.MoveNext
Wend
' reset the cursor to the beginning
If (kdcjcx.CursorType > 0) Then
kdcjcx.MoveFirst
Else
kdcjcx.Requery
End If
' set the number of rows displayed on this page
If (kdcjcx_numRows < 0 Or kdcjcx_numRows > kdcjcx_total) Then
kdcjcx_numRows = kdcjcx_total
End If
' set the first and last displayed record
kdcjcx_first = 1
kdcjcx_last = kdcjcx_first + kdcjcx_numRows - 1
If (kdcjcx_first > kdcjcx_total) Then
kdcjcx_first = kdcjcx_total
End If
If (kdcjcx_last > kdcjcx_total) Then
kdcjcx_last = kdcjcx_total
End If
End If
%>