title: Recordset Paging isn't Working
body: <p>Can anyone tell me why my recordset paging isn't working. I don't know a whole lot about this stuff, the parts of it I have in my code I pulled from this Microsoft website link: <a href="http://support.microsoft.com/kb/202125" rel="nofollow">http://support.microsoft.com/kb/202125</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>Dim con, con2, rec, rec2, dsn, dsn2, sql, sql2, rName, sDate, eDate, intPageCount
  rName=Request.Form("rn")
  sDate=FormatDateTime(Request.Form("sD"), 2)
  eDate=FormatDateTime(Request.Form("eD"), 2)
  
  dsn = "Radio"
  dsn2 = "InfoLib_SQL"
  sql = "SELECT * FROM T_RadioControlLog WHERE RadioName = '"&amp;rName&amp;"' AND CONVERT(date, Date, 101) &gt;= 
         CONVERT(date, '"&amp;sDate&amp;"', 101) AND CONVERT(date, Date, 101) &lt;= CONVERT(date, '"&amp;eDate&amp;"', 101)"
  
  set con=Server.CreateObject("ADODB.Connection")
  set rec=Server.CreateObject("ADODB.Recordset")
  rec.CursorLocation=3
  
  con.Open dsn, "pw", "pw"
  rec.Open sql, con
  rec.PageSize=5
  intPageCount=rec.PageCount
  
  Select Case Request("Action")
      case "&lt;&lt;"
          intpage =1
      case"&lt;"
          intpage = Request("intpage")-1
          if intpage &lt; 1 then intpage = 1
      case "&gt;"
          intpage = Request("intpage")+1
          if intpage &gt; intPageCount then intpage = intPageCount
      case "&gt;&gt;"
          intpage = intPageCount
      case else
          intpage = 1
  end select
  
  If NOT rec.eof Then
  Response.write("&lt;table&gt;")
  rec.AbsolutePage = intpage
  For intRecord = 1 to rec.PageSize
      Response.write("&lt;tr&gt;&lt;td&gt;Radio Name&lt;/td&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;Employee Name&lt;/td&gt;&lt;td&gt;ID#&lt;/td&gt;&lt;/tr&gt;")   
      Response.write("&lt;tr&gt;&lt;td&gt;" &amp; rec.fields("RadioName") &amp; "&lt;/td&gt;")  
      Response.Write("&lt;td&gt;" &amp; rec.fields("Date") &amp; "&lt;/td&gt;")
      set con2=Server.CreateObject("ADODB.Connection")
      set rec2=Server.CreateObject("ADODB.Recordset")
      sql2 = "SELECT EMP_NA FROM EMP_TABLE WHERE ID='"&amp;rec.fields("ID#")&amp;"'"
      con2.Open dsn2, "pw", "pw"
      rec2.Open sql2, con2
      Response.Write("&lt;td&gt;" &amp; rec2.fields("EMP") &amp; "&lt;/td&gt;")
      Response.Write("&lt;td&gt;" &amp; rec.fields("ID#")&amp; "&lt;/td&gt;&lt;/tr&gt;")
      rec.movenext
      rec2.close
      con2.close
      set rec2=nothing
      set con2=nothing
  If rec.EOF Then Exit For
  Next
  %&gt;
  &lt;tr&gt;
  &lt;form name="pageNav" action="results.asp" method="post"&gt;
  &lt;input type="hidden" name="intpage" value="&lt;%=intpage%&gt;"&gt;
  &lt;input type="submit" name="Action" value="&lt;&lt;"&gt;
  &lt;input type="submit" name="Action" value="&lt;"&gt;
  &lt;input type="submit" name="Action" value="&gt;"&gt;
  &lt;input type="submit" name="Action" value="&gt;&gt;"&gt;
  Page: &lt;%=intpage &amp; " of " &amp; intPageCount%&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;/table&gt;
  &lt;%
  Else
  Response.write("Sorry, no entries were found.")
  End If
  
  
  rec.close
  set rec=nothing
  con.close
  set con=nothing
  </code></pre>
  
  <p>The calls to the DB work and entries are definetly returned, I get a small table with 5 entries as my recordset is set to return but when I click the <code>&gt;&gt;, &lt;, &gt;, etc.</code> it doesn't display anything, the page just goes blank. If someone can explain how recordset paging works that would be great.</p>