home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
MS_DEV
/
VID
/
SERVER
/
ASF
/
DATA.Z
/
ado4.asp
< prev
next >
Wrap
Text File
|
1996-10-07
|
764b
|
35 lines
<HTML>
<H1>ActiveX Data Objects</H1>
<H2>Simple Example Retrieving all results into an array</H2>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "ADOSamples"
sql="SELECT * FROM Orders"
Set RS = Conn.Execute(sql)
%>
Here are the results from the query:<BR><i><b> <%=sql%></i></b><P>
<P>
<TABLE BORDER=1>
<TR>
<% For i = 0 to RS.Fields.Count - 1 %>
<TD><B><%= RS(i).Name %></B></TD>
<% Next %>
</TR>
<%
' Put up to 100 rows in a 2d variant array
v=RS.GetRows(100)
RS.close
Conn.close
%>
<P>
<%for row = 0 to UBound(v,2) ' iterate through the rows in the variant array%>
<TR>
<%for col = 0 to UBound(v,1)%>
<TD> <%=v(col,row)%> </TD>
<%next%>
</TR>
<%next%>
</TABLE>
</HTML>