Total record count before results

Results 1 to 2 of 2

Thread: Total record count before results

  1. #1
    Paul Hudson Guest

    Default Total record count before results

    I have a recordset called RS and just want to display the amount of records retrieved before the query results are displayed below.<BR><BR>I tried looking through the MSDN CD and it said about the getCount method, but I cant get it to work:<BR><BR>---<BR><BR>&#060;%<BR> Response.write(RS.getCount & " records retrieved")<BR>&#037;&#062;<BR><BR>---

  2. #2
    Join Date
    Dec 1969

    Default RE: Total record count before results

    I did some thing simular on one of my pages. I used the code below :<BR><BR>&#060;snip><BR> &#039Set connection to Database<BR> Set DataConn = Server.CreateObject("ADODB.Connection")<BR> Set AccidentRS = Server.CreateObject("ADODB.Recordset")<BR> <BR> AccidentRS.cursortype= 3<BR> <BR> &#039Open DB<BR> DataConn.Open "DSN=incident"<BR> &#039Create SQL string<BR> SQL = "SELECT * FROM MyTable"<BR> &#039Execute SQL string<BR> AccidentRS.Open SQL, DataConn<BR> &#039Display Record Count<BR> response.write AccidentRS.recordcount<BR><BR>&#060;snip><BR><BR>H ope that helps<BR><BR>Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts