Professional Web Applications Themes

Why does the RecordCount property always = -1 - Macromedia Dreamweaver

I have a working set of data coming back from my database without any problems. I am trying to add a textbox to each row of repeated data and since I want to take that data to the next page with me to indicate which checkboxes have been selected, I wanted to assign the value to each checkbox that matches is number in the recordset. It would be absolutely wonderful IF it would start numbering them and increment 1 for each record. The problem was to determine how many records are in a recordset so I could start the numbers, ...

  1. #1

    Default Why does the RecordCount property always = -1

    I have a working set of data coming back from my database without any
    problems. I am trying to add a textbox to each row of repeated data and
    since I want to take that data to the next page with me to indicate which
    checkboxes have been selected, I wanted to assign the value to each checkbox
    that matches is number in the recordset. It would be absolutely wonderful
    IF it would start numbering them and increment 1 for each record. The
    problem was to determine how many records are in a recordset so I could
    start the numbers, but the obvious choice - rs.RecordCount property always
    returns -1 even when there are 10 records and it displays the records. What
    gives??

    Thanks
    George


    George Mizzell Guest

  2. #2

    Default Re: Why does the RecordCount property always = -1

    Rob's got an extension for this on [url]www.robgt.com[/url]

    --

    Jules
    [url]http://www.charon.co.uk[/url]

    Charon Cart 3
    [url]http://www.charon.co.uk/charoncart[/url]

    ICQ 51328805



    George Mizzell wrote:
    > I have a working set of data coming back from my database without any
    > problems. I am trying to add a textbox to each row of repeated data
    > and since I want to take that data to the next page with me to
    > indicate which checkboxes have been selected, I wanted to assign the
    > value to each checkbox that matches is number in the recordset. It
    > would be absolutely wonderful IF it would start numbering them and
    > increment 1 for each record. The problem was to determine how many
    > records are in a recordset so I could start the numbers, but the
    > obvious choice - rs.RecordCount property always returns -1 even when
    > there are 10 records and it displays the records. What gives??
    >
    > Thanks
    > George

    Julian Roberts Guest

  3. #3

    Default Re: Why does the RecordCount property always = -1

    Thanks Ron

    That does look a lot more simple.

    George

    "Ron" <ron0079spamaol.com> wrote in message
    news:beqr1m$c2h$1forums.macromedia.com...
    > Use the properties inspector to set the recordset's cursor location to
    > adUseServer and you'll get your RecordCount property.
    >
    > Although, for what you want to do (number rows in a repeat region), you
    > really won't need it, just a little modification:
    >
    > <%
    > Dim i
    > i = 1
    > While Not rs.EOF
    > %>
    > Row # <%= i %> - <%= rs.Fields.Item( ... ).Value %><br>
    > <%
    > i = i + 1
    > rs.MoveNext
    > Wend
    > %>
    >
    > --
    > Ron
    >
    >

    George Mizzell Guest

Similar Threads

  1. Replies: 0
    Last Post: November 13th, 11:04 AM
  2. recordCount property
    By fu-meng in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: May 16th, 03:48 PM
  3. Getting a recordcount
    By Andy Levy in forum PHP Development
    Replies: 3
    Last Post: October 29th, 08:55 AM
  4. recordcount -1
    By middletree in forum ASP
    Replies: 8
    Last Post: October 16th, 02:06 PM
  5. RecordCount Property and SQL
    By Scott in forum ASP Database
    Replies: 2
    Last Post: July 22nd, 01:17 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139