On Wed, May 30, 2001 at 07:55:28PM +0000, [EMAIL PROTECTED] wrote:
> I am not sure if I am doing something wrong in mySQL, but I have
> tested the following in Microsoft SQL, Access and Oracle it works
> fine in those environments, but unfortunately, it does not work in
> mySQL.
>
> I have a simple query, such as:
>
> select name, count(*) from tbl_users group by name;
>
> In the mySQL client, this query returns the proper results. However,
> if I create an ASP page to deliver the results it does not work. It
> returns 0 records. However, if I remove count(*) from the query, it
> will then return the records just not in the format I want it. Like
> I said, this works fine in Microsoft SQL, Access and Oracle.
Hm. It's been about 2 years since I cared about ASP, but maybe I can
help...
> My ASP code is as follows:
>
> <%
>
> set oRS = server.createobject("ADODB.Recordset")
> set oDB = server.createobject("ADODB.Connection")
>
> oDB.Open "DSN=<dsn name>"
>
> sSQL = "SELECT name, count(*) from tbl_users group by name;"
How about
sSQL = "SELECT name, count(*) as CNT from tbl_users group by name;"
> oRS.Open sSQL, oDB
> if not oRS.EOF then
> while not oRS.EOF
> response.write oRS("NAME")
and
response.write oRS("CNT")
?
Jeremy
--
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 439-9951
MySQL 3.23.29: up 5 days, processed 32,847,635 queries (72/sec. avg)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php