Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003

    Unanswered: Recordset Counts

    I am trying to count the number of records in a recordset I have created. It always returns a value of -1 nomatter how many records are actually there. I have other operations working fine using similar code, but this one will not work correctly. Can anyone help. Here is the code.

    Set ashcontentcountcmd = New ADODB.Command
    ashcontentcountcmd.ActiveConnection = ashconn
    Set ashcontentcountrs = New ADODB.Recordset
    ashcontentcountrs.ActiveConnection = ashconn

    ashsource = lstash.List(lstash.ListIndex)

    ashcontentcount = "select ID from Flyash where Source ='" + ashsource + "'"

    ashcontentcountcmd.CommandText = ashcontentcount ashcontentcountrs.Open ashcontentcountcmd

    Debug.Print ashcontentcountrs.RecordCount

    Thank you in advance for any help.


  2. #2
    Join Date
    Feb 2002
    You need to make it a client-side cursor to return the recordcount or your cursor is the wrong type.

  3. #3
    Join Date
    Dec 2003
    I am new to this stuff. I don't know what you mean by a client-side cursor. This is an Access database I am connecting to.

Posting Permissions

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