Results 1 to 8 of 8

Thread: [RESOLVED] rst.recordcount

  1. #1

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Resolved [RESOLVED] rst.recordcount

    Hi ..

    Iam really wondering that y iam not getting the record count that which was buit by using ADOs ..
    Im sure that there are records in the recordaset object..Im able to loop through all the records..but y was the "recordcount" function returing value as -1????

    Can any one tell me that is there any thing specifically i have to do to get record count ...

    thanx & regards
    Anu..
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

  2. #2
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: rst.recordcount

    Can you post your code? Also take a look at the links in my signature regarding connecting via ADO to either an Access DB or MySQL.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: rst.recordcount

    Use either adOpenKeyset or adOpenStatic as the CursorType for server side cursors or use a client side cursor. Client side cursors use only adOpenStatic for CursorTypes regardless of which CursorType you select.

  4. #4
    Hyperactive Member shirishdawane's Avatar
    Join Date
    Dec 2004
    Location
    Mumbai,India
    Posts
    363

    Re: rst.recordcount

    Hello Hack,

    the same problm i am getting & i also posted thread regarding my problem today mornig only subjected that "working fine with SQL server 2000 but not in VB 6.0", but not get any satisfactory answer.....plz help...it will be benificial for me as well as this person....
    On Error GoTo http://www.vbforums.com

    Note :
    1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
    2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.

  5. #5

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Lightbulb Re: rst.recordcount

    yes....it worked out....thanQ hack..

    but why the problem occurs with adopendynamic????

    any how thaks once again for u r help..
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: rst.recordcount

    Then, change your cursor type and you will get a proper recordcount.

    If you don't wish to change your cursor type, then the alternative is to do a SQL SELECT COUNT

  7. #7
    Fanatic Member lerroux's Avatar
    Join Date
    Nov 2005
    Location
    Welcome to the darkside... we have cookies
    Posts
    646

    Re: rst.recordcount

    hi, i'm having a similar problem... i tried to change my cursor type to either openkeyset or openstatic and still generated a problem...
    for openstatic, i develop an error: "arguments are of the wrong type..."

    for openkeyset, i still get a -1 value for recordcount....

    how do you do a SQL SelectCount?

  8. #8
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: rst.recordcount

    Hack was talking about using the following sql statement:

    VB Code:
    1. strSQL = SELECT Count(*) as Counter  FROM YourTableName WHERE Yourcondtion
    Last edited by Mark Gambo; Dec 12th, 2005 at 08:38 PM.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


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