Results 1 to 3 of 3

Thread: Recordcount

  1. #1
    Join Date
    Dec 1969

    Default Recordcount

    I am opening a Database connction with ADODB.connection, and I am executing a SQL statement as<BR>set rs= DBConn.execute(sql)<BR>But when I try to display the recordcount as rs.recordcount, it always displays -1 though records exists in the recordset. What could be the reason and how to display Recordset?

  2. #2
    Bikash Panda Guest

    Default RE: Recordcount

    Hi Vikranth,<BR>You must use the proper cursor to make use of RecordCount property of the Recordset object. By default it is ForwardOnly which shows the RecordCount value as -1. You can use Static cursor.

  3. #3
    Join Date
    Dec 1969

    Default RE: Recordcount

    I was getting the same &#039error&#039 last summer when i tried to do a record count. It seems so logical that it should work the way you would think it would... but it doesn&#039t.<BR><BR>At that time prompted the guys at to write up a sample on this topic, here is the url:<BR><BR><BR><BR>For my own purposes, it was easier to make a function to do the count &#039manually&#039. I know it might not be the proper way to do it, but it works.-<BR><BR>&#060;%<BR>foundRecords = 0<BR>Do While Not rs.EOF<BR> foundRecords = foundRecords + 1<BR> %&#062;<BR> &#060;% rs.MoveNext<BR> Loop %&#062;<BR>%&#062;<BR><BR>Either way, i hope this helps,<BR>Timm

Posting Permissions

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