Results 1 to 3 of 3

Thread: Recordcount property of ADO

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29
    After setting a new recordset in ADO, I am attempting to find out how many records are in it by using the RecordCount property. Things haven't turned out as expected and after using a breakpoint in the code I discovered that the RecordCount value was set to -1.

    Looking up MSDN Library, I have found that this value is set when the number of records cannot be determined. Does anyone have any ideas or likely scenarios that would lead to this.

    The recordset is definitely open and according to MSDN Library, an error message would occur if it was closed. Why would the RecordCount property not be returned?

  2. #2
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    This is related to the cursor type. The default is forward only. you need to change this when opening the recordset to any other type which supports record count.

    HTH

    Lenin

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29
    Thanks, solved the problem

Posting Permissions

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



Click Here to Expand Forum to Full Width