List:General Discussion« Previous MessageNext Message »
From:Christopher R. Jones Date:September 10 2000 4:09pm
Subject:Re: Problem with RecordCount with ASP & MySQL
View as plain text  
recordcount does not work but there is a work around.  Use the GetRows method with an
array variant to store the selected rows (JavaScrip example, I don't use VBScript):
<%
ConnectionString1a = "DSN=NT2Buildings;User
Id=cjones;PASSWORD=spikeo;DB=buildings;SERVER=crjnt2;UID=cjones;PORT=;OPTION=0;STMT=;"
conn1 = Server.CreateObject('ADODB.Connection');
conn1.Open( ConnectionString1a );
sql = "SELECT DISTINCT * FROM rates_emissions";
rs1 = Server.CreateObject("ADODB.Recordset");
rs1.Open( sql, conn1);
arr1 = rs1.GetRows();

temp1 = arr1.ubound(2)+1;
//temp1 stores the number of records retrieved.
rs1.MoveFirst();
var i;
for( i=0; i<temp1; i++ )
{
         rate = rs1('rate_id');
         fuel = rs1('fuellabel');
         Response.Write( "<h1>" + bldg + "&nbsp;" + tpl + "</h1>" );
         rs1.MoveNext();
}%>

>Read archives. Doesn't work in MyODBC. Perhaps it will sometime soon because in a
> discussion a few days ago one of the developers seemed to indicate it _should_ work, but
> it never has in the past and as of the present it doesn't.
>
>Jamie
>
>At 08:47 AM 9/10/00, Ayende Rahien wrote:
>>I'm trying to use recordcount to find out how many records there are in a
>>recordset.
>>I'm getting recordcount = -1
>>I've encountered this problem before in a Access Database, and successfully
>>solved it.
>
>
>-- 
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/php/manual.php" before
>posting. To request this thread, e-mail mysql-thread50198@stripped
>
>To unsubscribe, send a message to:
>    <mysql-unsubscribe-cj=interlog.com@stripped>
>
>If you have a broken mail client that cannot send a message to the above
> address(Microsoft Outlook), you can use http://lists.mysql.com/php/unsubscribe.php
>


Christopher R. Jones, P.Eng.
14 Oneida Avenue
Toronto, Ontario M5J 2E3
Tel. 416 203-7465
Fax. 416 203-3044
Email cj@stripped


Thread
Problem with RecordCount with ASP & MySQLAyende Rahien10 Sep
  • Re: Problem with RecordCount with ASP & MySQLJames Treworgy10 Sep
    • Re: Problem with RecordCount with ASP & MySQLChristopher R. Jones10 Sep
      • Re: Problem with RecordCount with ASP & MySQLJames Treworgy10 Sep
Re: Problem with RecordCount with ASP & MySQLDaniel C BAUFAY10 Sep
  • Re: Problem with RecordCount with ASP & MySQLJames Treworgy10 Sep
Re: Problem with RecordCount with ASP & MySQLDaniel C BAUFAY10 Sep
Re: Problem with RecordCount with ASP & MySQLDaniel C BAUFAY10 Sep
Re: Problem with RecordCount with ASP & MySQLDaniel C BAUFAY10 Sep