rs.Recordcount isn't working with mySQL

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default rs.Recordcount isn't working with mySQL

    Hi,
    I'm using a recordset object to open a sql statement(select * from
    tablename)
    and for some reason the rs.recordcount value is always 0.
    and I know there are above 20 records in this table

    is any1 familiar with this problem and knows how to solve it?

    Roy.


    Roy Danon Guest

  2. Similar Questions and Discussions

    1. #38842 [Com]: PDO nextRowset not working on MySQL
      ID: 38842 Comment by: mike at we11er dot co dot uk Reported By: stochnagara at hotmail dot com Status: Open...
    2. MySQL Query Cache Not Working: MySQL 5 / Windows XP
      Please excuse this post if you've already read it on mailing.database.mysql - i just discovered these other groups. future posts will be...
    3. insert blob in MySQL (CF_SQL_BLOB) not working
      I've read the post about "insert blob in oracle (CF_SQL_BLOB) not working" and followed the solution. The only difference here is that I am dealing...
    4. [PHP] RH9.0: Upgrade to 4.3, mysql functions not working
      "undefined function mysql_select". mysql_select by itself isn't a function. Are you using other code to define this function? Or are you just...
    5. RH9.0: Upgrade to 4.3, mysql functions not working
      Hi Folks, I've got a (in my eyes) very strange behaviour from my RedHat Linux 9.0 box. I needed to upgrade my PHP version to 4.3, since that's...
  3. #2

    Default Re: rs.Recordcount isn't working with mySQL

    [url]http://www.aspfaq.com/show.asp?id=2193[/url]

    Perhaps that could help?

    --
    Manohar Kamath
    Editor, .netBooks
    [url]www.dotnetbooks.com[/url]


    "Roy Danon" <admin@droyd.net> wrote in message
    news:btov19$5c3$1@news2.netvision.net.il...
    > Hi,
    > I'm using a recordset object to open a sql statement(select * from
    > tablename)
    > and for some reason the rs.recordcount value is always 0.
    > and I know there are above 20 records in this table
    >
    > is any1 familiar with this problem and knows how to solve it?
    >
    > Roy.
    >
    >

    Manohar Kamath [MVP] Guest

  4. #3

    Default Re: rs.Recordcount isn't working with mySQL

    Thanks for the reply,
    but it doesn't help..

    the first solution is the same as what i'm doin
    the second is only for getrows which i don't always use
    and the third is for MSSQL...


    any other answers?


    Roy.


    "Manohar Kamath [MVP]" <mkamath@TAKETHISOUTkamath.com> wrote in message
    news:eq9qUX51DHA.484@TK2MSFTNGP10.phx.gbl...
    > [url]http://www.aspfaq.com/show.asp?id=2193[/url]
    >
    > Perhaps that could help?
    >
    > --
    > Manohar Kamath
    > Editor, .netBooks
    > [url]www.dotnetbooks.com[/url]
    >
    >
    > "Roy Danon" <admin@droyd.net> wrote in message
    > news:btov19$5c3$1@news2.netvision.net.il...
    > > Hi,
    > > I'm using a recordset object to open a sql statement(select * from
    > > tablename)
    > > and for some reason the rs.recordcount value is always 0.
    > > and I know there are above 20 records in this table
    > >
    > > is any1 familiar with this problem and knows how to solve it?
    > >
    > > Roy.
    > >
    > >
    >
    >

    Roy Danon Guest

  5. #4

    Default Re: rs.Recordcount isn't working with mySQL

    > the first solution is the same as what i'm doin

    How do we know that? SHOW YOUR CODE.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

  6. #5

    Default Re: rs.Recordcount isn't working with mySQL

    Here you go :)

    set rsNewsQuick=server.CreateObject("ADODB.recordset")
    sqlNews="SELECT * FROM QuickNews order by id desc"
    rsNewsQuick.Open sqlNews,dsn,1,1


    Thanks,
    Roy.

    "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    news:Oh80bR%231DHA.4064@tk2msftngp13.phx.gbl...
    > > the first solution is the same as what i'm doin
    >
    > How do we know that? SHOW YOUR CODE.
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > [url]http://www.aspfaq.com/[/url]
    >
    >

    Roy Danon Guest

  7. #6

    Default Re: rs.Recordcount isn't working with mySQL

    And which driver are you using to connect to mySQL? Have you consulted its
    documentation to see whether it even supports recordcount? If it does not,
    have you tried any other driver(s)?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "Roy Danon" <admin@droyd.net> wrote in message
    news:btre0k$735$1@news2.netvision.net.il...
    > Here you go :)
    >
    > set rsNewsQuick=server.CreateObject("ADODB.recordset")
    > sqlNews="SELECT * FROM QuickNews order by id desc"
    > rsNewsQuick.Open sqlNews,dsn,1,1
    >
    >
    > Thanks,
    > Roy.
    >
    > "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    > news:Oh80bR%231DHA.4064@tk2msftngp13.phx.gbl...
    > > > the first solution is the same as what i'm doin
    > >
    > > How do we know that? SHOW YOUR CODE.
    > >
    > > --
    > > Aaron Bertrand
    > > SQL Server MVP
    > > [url]http://www.aspfaq.com/[/url]
    > >
    > >
    >
    >

    Aaron Bertrand [MVP] Guest

  8. #7

    Default Re: rs.Recordcount isn't working with mySQL

    Hi,
    I'm using the driver my hosting service adviced me to use :

    "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Port=3306; Option=0;
    Socket=; Stmt=; Database=xxx_xxx; UID=xxx_xxx; PWD=xxx;"

    where can i find it's documention?

    Roy.

    "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    news:OByO3zE2DHA.1264@TK2MSFTNGP11.phx.gbl...
    > And which driver are you using to connect to mySQL? Have you consulted
    its
    > documentation to see whether it even supports recordcount? If it does
    not,
    > have you tried any other driver(s)?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > [url]http://www.aspfaq.com/[/url]
    >
    >
    >
    >
    > "Roy Danon" <admin@droyd.net> wrote in message
    > news:btre0k$735$1@news2.netvision.net.il...
    > > Here you go :)
    > >
    > > set rsNewsQuick=server.CreateObject("ADODB.recordset")
    > > sqlNews="SELECT * FROM QuickNews order by id desc"
    > > rsNewsQuick.Open sqlNews,dsn,1,1
    > >
    > >
    > > Thanks,
    > > Roy.
    > >
    > > "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    > > news:Oh80bR%231DHA.4064@tk2msftngp13.phx.gbl...
    > > > > the first solution is the same as what i'm doin
    > > >
    > > > How do we know that? SHOW YOUR CODE.
    > > >
    > > > --
    > > > Aaron Bertrand
    > > > SQL Server MVP
    > > > [url]http://www.aspfaq.com/[/url]
    > > >
    > > >
    > >
    > >
    >
    >

    Roy Danon Guest

  9. #8

    Default Re: rs.Recordcount isn't working with mySQL

    Roy,

    Have you tried looping through the recordset to see if there are any
    records, maybe zero is the right answer.

    --
    Manohar Kamath
    Editor, .netBooks
    [url]www.dotnetbooks.com[/url]


    "Roy Danon" <admin@droyd.net> wrote in message
    news:btre0k$735$1@news2.netvision.net.il...
    > Here you go :)
    >
    > set rsNewsQuick=server.CreateObject("ADODB.recordset")
    > sqlNews="SELECT * FROM QuickNews order by id desc"
    > rsNewsQuick.Open sqlNews,dsn,1,1
    >
    >
    > Thanks,
    > Roy.
    >
    > "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    > news:Oh80bR%231DHA.4064@tk2msftngp13.phx.gbl...
    > > > the first solution is the same as what i'm doin
    > >
    > > How do we know that? SHOW YOUR CODE.
    > >
    > > --
    > > Aaron Bertrand
    > > SQL Server MVP
    > > [url]http://www.aspfaq.com/[/url]
    > >
    > >
    >
    >

    Manohar Kamath [MVP] Guest

  10. #9

    Default Re: rs.Recordcount isn't working with mySQL

    Did you try [url]www.mysql.com?[/url]

    Also, there are methods in the article posted that you may have missed or
    ignored, such as:

    set rs = conn.execute("SELECT COUNT(*) FROM table WHERE ...")
    response.write rs(0) & " rows."
    set rs = conn.execute("SELECT * FROM table WHERE ...")
    if not rs.eof then
    ' ... process rs
    end if

    Also, just because you "don't always use" GetRows doesn't mean it is an
    invalid solution for the problem you are currently having. You probably
    "don't always use" a recordcount at all, either.

    You seemed to discard it without a thought. Maybe you gave as much thought
    to the database platform you chose.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "Roy Danon" <admin@droyd.net> wrote in message
    news:bts32c$eum$1@news2.netvision.net.il...
    > Hi,
    > I'm using the driver my hosting service adviced me to use :
    >
    > "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Port=3306; Option=0;
    > Socket=; Stmt=; Database=xxx_xxx; UID=xxx_xxx; PWD=xxx;"
    >
    > where can i find it's documention?
    >
    > Roy.

    Aaron Bertrand [MVP] Guest

  11. #10

    Default Re: rs.Recordcount isn't working with mySQL

    Hi,
    My problem is actually that my website contains over 100 pages which
    connects to the database and displays records using "for i = 1 to
    rs.recordcount" or GetRows.
    And I really don't have time to change my entire website and use getrows
    instead of looping, because only about 10% of the webpages were converted to
    GetRows after i had some resources issues.

    So, first of all thank you.
    I've returned to use MSSQL instead, and it meanwhile the site is online i
    will change the pages to other methods and stop using recordcount and when
    the site will be ready I will try and change my DB to mySQL again.


    Thanks for everything,
    Roy.
    "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    news:uT4pL1H2DHA.1908@TK2MSFTNGP10.phx.gbl...
    > Did you try [url]www.mysql.com?[/url]
    >
    > Also, there are methods in the article posted that you may have missed or
    > ignored, such as:
    >
    > set rs = conn.execute("SELECT COUNT(*) FROM table WHERE ...")
    > response.write rs(0) & " rows."
    > set rs = conn.execute("SELECT * FROM table WHERE ...")
    > if not rs.eof then
    > ' ... process rs
    > end if
    >
    > Also, just because you "don't always use" GetRows doesn't mean it is an
    > invalid solution for the problem you are currently having. You probably
    > "don't always use" a recordcount at all, either.
    >
    > You seemed to discard it without a thought. Maybe you gave as much
    thought
    > to the database platform you chose.
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > [url]http://www.aspfaq.com/[/url]
    >
    >
    >
    >
    > "Roy Danon" <admin@droyd.net> wrote in message
    > news:bts32c$eum$1@news2.netvision.net.il...
    > > Hi,
    > > I'm using the driver my hosting service adviced me to use :
    > >
    > > "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Port=3306; Option=0;
    > > Socket=; Stmt=; Database=xxx_xxx; UID=xxx_xxx; PWD=xxx;"
    > >
    > > where can i find it's documention?
    > >
    > > Roy.
    >
    >

    Roy Danon Guest

  12. #11

    Default Re: rs.Recordcount isn't working with mySQL

    No, there are about 20 records, and i havn't given any creteria(where ...)

    Thanks,
    Roy.
    "Manohar Kamath [MVP]" <mkamath@TAKETHISOUTkamath.com> wrote in message
    news:O9N69dH2DHA.3140@tk2msftngp13.phx.gbl...
    > Roy,
    >
    > Have you tried looping through the recordset to see if there are any
    > records, maybe zero is the right answer.
    >
    > --
    > Manohar Kamath
    > Editor, .netBooks
    > [url]www.dotnetbooks.com[/url]
    >
    >
    > "Roy Danon" <admin@droyd.net> wrote in message
    > news:btre0k$735$1@news2.netvision.net.il...
    > > Here you go :)
    > >
    > > set rsNewsQuick=server.CreateObject("ADODB.recordset")
    > > sqlNews="SELECT * FROM QuickNews order by id desc"
    > > rsNewsQuick.Open sqlNews,dsn,1,1
    > >
    > >
    > > Thanks,
    > > Roy.
    > >
    > > "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    > > news:Oh80bR%231DHA.4064@tk2msftngp13.phx.gbl...
    > > > > the first solution is the same as what i'm doin
    > > >
    > > > How do we know that? SHOW YOUR CODE.
    > > >
    > > > --
    > > > Aaron Bertrand
    > > > SQL Server MVP
    > > > [url]http://www.aspfaq.com/[/url]
    > > >
    > > >
    > >
    > >
    >
    >

    Roy Danon Guest

  13. #12

    Default Re: rs.Recordcount isn't working with mySQL

    > I've returned to use MSSQL instead, and it meanwhile the site is online i
    > will change the pages to other methods and stop using recordcount and when
    > the site will be ready I will try and change my DB to mySQL again.
    Usually, MySQL is used when the cost of SQL Server or other RDBMS platforms
    is too prohibitive. If SQL Server is available, and it works, why do you
    feel the need to switch to MySQL?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand - MVP Guest

Posting Permissions

  • You may not post new threads
  • You may 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