recordcount = -1

Results 1 to 7 of 7

Thread: recordcount = -1

  1. #1
    Join Date
    Dec 1969
    Posts
    157

    Default recordcount = -1

    Specify the cursorType in the open method<BR>set rs = createobject("adodb.recordset")<BR>rs.cursortype=a dOpenKeyset<BR>sql = "select fields from table where [...]"<BR>rs.open sql, dbconnection, adOpenKeyset<BR><BR>even after this i still dont get my rs.recordcount property working. anything else i need to do.<BR>i have also tried putting all the five arguments for rs.open<BR><BR>bill ...ru there

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default adOpenStatic

    I&#039;m pretty sure you only get a valid record count with adOpenStatic.<BR><BR>There&#039;s a page that summarizes all the available properties per cursor type on http://www.LearnASP.com<BR><BR>Search for "Phil Paxton" and/or "cursors" or "cursor types". I know he wrote the article.<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    464

    Default rs.open sql, dbconnection, adOpenKeyset, adLockOpt

    =]... of course I would just use getrows then get then use ubound.

  4. #4
    Join Date
    Dec 1969
    Posts
    96,118

    Default RE: adOpenStatic

    http://www.learnasp.com/learn/dbcount.asp<BR><BR>Yep. adOpenStatic or adOpenDynamic, only.<BR><BR>But read the warnings here about performance!<BR><BR><BR><BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    96,118

    Default Hmmm...disagreement...

    You say adOpenKeyset, and this page says adOpenKeyset:<BR><BR>http://www.learnasp.com/learn/adocursortypes.asp<BR><BR>But the other page I referred to clearly said only adOpenStatic and adOpenDynamic.<BR><BR>&#060;shrug&#062;I dunno. But when I&#039;ve done it, I&#039;ve used adOpenStatic. But I recommend other ways, if available, in any case.&#060;/shrug&#062;<BR><BR>

  6. #6
    Join Date
    Dec 1969
    Posts
    464

    Default No I think your right.. <shrug>Oh well

    Im not worthy... Locktype isnt the problem its cursor.. I thought that keyset would return count and it was the locktype but thats rediculous.. the cursor determines whether or not there can be a recordcount... My bad...

  7. #7
    Join Date
    Dec 1969
    Posts
    96,118

    Default But Phil agrees with you...

    ...and I have a lot of respect for Phil Paxton&#039;s statements.<BR><BR>Oh, well...I guess we both agree that adOpenStatic will work, so why not use it and play it safe?<BR><BR>I&#039;ll experiment with the others later.<BR><BR>

Posting Permissions

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