ASP > Database articles:
• How do I get a RecordSet (a bunch of records) from a database using ASP?
Read
• Once I have my RecordSet (a bunch of records) from my database, how do I loop through the records and display them using ASP?
|
Return to index of articles
Once I have my RecordSet (a bunch of records) from my database, how do I loop through the records and display them using ASP?
Category: ASP
Category: Database
<%
if rsName.EOF then
response.write("No records found.")
else
do until rsName.EOF
response.write( rsName("fieldName1") )
response.write( " - " )
response.write( rsName("fieldName2") )
response.write( " " )
' ETC...
rsName.moveNext
loop
end if
%>
Don't forget to close your objects and get rid of them so they can be returned to the connection pool:
rsName.close
set rsName=NOTHING
Conn.close
set Conn=NOTHING
9/2/2003
|