Number of Records

Results 1 to 2 of 2

Thread: Number of Records

  1. #1
    Join Date
    Dec 1969

    Default Number of Records

    Can anyone help?<BR><BR>I am trying to figure out how many records my SELECT statement is actually selecting?<BR><BR>SO far I have:<BR>SELECT * FROM tblName WHERE Month=8<BR>Now I just need to know how many records there actually are?<BR>-thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Number of Records

    *IF* you open the RecordSet with the right kind of cursor (and *if* the DB you are using supports that kind of cursor), then you can use the RecordCount property.<BR><BR>Thus:<BR><BR>&#060;%<BR>SQL = "SELECT * FROM tblName WHERE Month=8"<BR>SET RS = Server.CreateObject("ADODB.RecordSet")<BR>RS.Open SQL, someConnection, 3, 3, 1 &#039 see docs for RecordSet.Open!!!<BR>count = RS.RecordCount<BR>%&#062;<BR><BR>But if that gives you -1 for the RecordCount, then your DB doesn&#039t support cursor type 3.<BR><BR>At which point you try other things.<BR><BR>NOTE: This info is in *any* good ASP book, or you can go peruse and the "Database Lessons".<BR><BR><BR><BR>

Posting Permissions

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