Results 1 to 6 of 6

Thread: recordset.recordcount not working as expected [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    recordset.recordcount not working as expected [RESOLVED]

    I'm trying to find the total number of records in a recordset by using rs.recordcount. It always returns -1 and I know (by using data I created JUST for this) that there should be 2 records
    Last edited by Andy; Mar 31st, 2004 at 12:41 PM.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    That may be because this is vb.net, where there is no recordset.
    You could use myDataSet.Tables("myTable").Rows.Count in vb.net

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    Originally posted by salvelinus
    That may be because this is vb.net, where there is no recordset.
    You could use myDataSet.Tables("myTable").Rows.Count in vb.net
    I'm using ado. (obviousely) and there IS a recordset. I have the cursor type set right (i thought that may be a problem).

    It makes no sense. I'll try out what you suggested and see if that works.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    ok. found out that it's not working 'cause the database is not setup to allow it.

    how can I use the count() function? I can't figure out how to read the return value from the function.

  5. #5
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Don't know, show some code. Why would you use ADO in .net? You might as well use vb6 in that case.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    well, I have argued with my project leader for months about ado vs ado.net He has more seniority lol

    I figured this out:

    You have to have two SELECT statements and use an if statement to check the value of the count().

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