I\'m not quite familiar with programming ASP classic. I just need a small code to run on my webpage. How do i count the record of the returned query?
<%
S
Get in the habbit of storing returned data in arrays. This is amazingly faster to iterate than using an open record set. Also, specify the fields to select when doing this as you have to explicitly reference the array index.
<%
Set rsscroll = Server.CreateObject("ADODB.Recordset")
Dim strSQLscroll, rsscroll
Dim arrCommon
'Open recordset, copy data to array
strSQLscroll = "SELECT field1, field2, field3 FROM tblItems where expiration_date > getdate() order by expiration_date desc;"
rsscroll.open strSQLscroll,oConn
arrCommon = rsscroll.getRows()
rsscroll.close
'Get the total records in this array
response.write ubound(arrCommon, 2);
'Loop...
for i = 0 to ubound(arrCommon, 2)
' This prints field 3
response.write arrCommon(2, i)
next
%>