<participant>
     <quickSearch><![CDATA[.RecordCount]]></quickSearch>
     <insertText location="aboveHTML+70">
<![CDATA[
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim @@rsName@@_total
Dim @@rsName@@_first
Dim @@rsName@@_last

' set the record count
@@rsName@@_total = @@rsName@@.RecordCount

' set the number of rows displayed on this page
If (@@rsName@@_numRows < 0) Then
  @@rsName@@_numRows = @@rsName@@_total
Elseif (@@rsName@@_numRows = 0) Then
  @@rsName@@_numRows = 1
End If

' set the first and last displayed record
@@rsName@@_first = 1
@@rsName@@_last  = @@rsName@@_first + @@rsName@@_numRows - 1

' if we have the correct record count, check the other stats
If (@@rsName@@_total <> -1) Then
  If (@@rsName@@_first > @@rsName@@_total) Then
    @@rsName@@_first = @@rsName@@_total
  End If
  If (@@rsName@@_last > @@rsName@@_total) Then
    @@rsName@@_last = @@rsName@@_total
  End If
  If (@@rsName@@_numRows > @@rsName@@_total) Then
    @@rsName@@_numRows = @@rsName@@_total
  End If
End If
%>
]]>
     </insertText>
     <searchPatterns whereToSearch="directive">
       <searchPattern paramNames="rsName"><![CDATA[/\b(\w+)_total\s*=\s*\w+\.RecordCount/]]></searchPattern>
     </searchPatterns>
     <updatePatterns>
       <updatePattern paramName="rsName"><![CDATA[/(\W)\w+(_total|_first|_last|_numRows|\.RecordCount)/g]]></updatePattern>
     </updatePatterns>
</participant>
