VB icon

ADO GetRows example

Email
Submitted on: 1/1/2015 12:21:00 AM
By: Found on the World Wide Web (from psc cd)  
Level: Beginner
User Rating: By 5 Users
Compatibility: ASP (Active Server Pages)
Views: 2983
 
     You can use ADO GetRows to output and ADO recordset to an array. This is often useful in n-tier applications when you are moving data between tiers--or if you want to persist your data in another way. http://adozone.cnw.com/default.htm
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: ADO GetRows example
' Description:You can use ADO GetRows to output and ADO recordset to an array. This is often useful in n-tier applications when you are moving data between tiers--or if you want to persist your data in another way.
http://adozone.cnw.com/default.htm
' By: Found on the World Wide Web (from psc cd)
'**************************************

<HTML>
<HEAD>
<TITLE>Place Document Title Here</TITLE>
</HEAD>
<BODY BGColor=ffffff Text=000000>
<%
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open Application("guestDSN")
sql = "SELECT * FROM authors"
Set RS = cn.Execute(sql)
ary = rs.GetRows(10) 
rs.close
cn.close
%>
<P>
<TABLE BORDER=1>
<% 
nRows = UBound( ary, 2 )
For row = 0 to nRows %>
<TR>
<% For col = 0 to UBound( ary, 1 ) %> 
<TD><%= ary( col, row ) %> </TD>
<% Next %>
</TR>
<% Next %>
</TABLE>
</HTML>


Other 11 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.