home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / MS_DEV / VID / SERVER / ASF / DATA.Z / ado5.asp < prev    next >
Text File  |  1996-10-07  |  570b  |  25 lines

  1. <HTML>
  2. <H1>ActiveX Data Objects</H1>
  3. <H2>Simple Example Query using a fetch loop</H2>
  4. <%
  5.   Set Conn = Server.CreateObject("ADODB.Connection")
  6.   Conn.Open "ADOSamples"
  7.   sql="select ProductName, ProductDescription from Products where ProductType in ('Boot', 'Tent')"
  8.   Set RS = Conn.Execute(sql)
  9. %>
  10. Here are the results from the query:<BR><i><b>  <%=sql%></i></b><P>
  11. <TABLE BORDER>
  12. <%while not RS.eof%>
  13. <TR>
  14. <TD><%=RS("ProductName")%></TD><TD><%=RS("ProductDescription")%></TD>
  15. </TR>
  16. <%
  17.   RS.MoveNext
  18. wend
  19. RS.close
  20. Conn.close
  21. %>
  22.  
  23. </TABLE>
  24. </HTML>
  25.