home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / HTMLTable_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  57 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit        %>
  3.  
  4. <HTML>
  5.  
  6. <HEAD>
  7. <TITLE>Query to Fill HTML Table (using ADO Table Component)</TITLE>
  8. </HEAD>
  9.  
  10.  
  11. <BODY bgcolor="white" topmargin="10" leftmargin="10">
  12.         
  13. <!-- Display Header -->
  14.  
  15. <font size="4" face="Arial, Helvetica">
  16. <b>Query to Fill HTML Table</b> (using ADO Table Component)
  17. </font>
  18. <br>   
  19. <hr size="1" color="#000000">
  20.  
  21. <%
  22.   Dim Conn            ' The connection object
  23.   Dim SQLstatement
  24.   Dim RecSet        ' The record set returned
  25.   Dim oHTMLTable    ' The HTML Table Formatter object
  26.   Dim iRows            ' The place holder for the number of rows returned in the record set
  27.  
  28.   Set Conn = Server.CreateObject("ADODB.Connection")
  29.  
  30.   ' You must first create the file DSN for this sample to look at.
  31.   ' This SDK comes with an authors.mdb in the same directory as this file
  32.   ' Go to Control Panels | ODBC | File DSN
  33.   ' Select Add and Microsoft Access Driver (*.mdb)
  34.   ' Name the DSN "Authors.dsn" and point it to the authors.mdb
  35.   Conn.Open "FILEDSN=Authors.dsn"
  36.  
  37.   SQLstatement = "SELECT * From Authors"
  38.  
  39.   Set RecSet = Conn.Execute(SQLstatement,iRows)
  40.  
  41.   ' This sample does NOT include the HTMLTable object.  You will need to get this
  42.   ' component from the Microsoft Web Site.  Follow the installation instructions 
  43.   ' which come with the component to install the component.
  44.   Set oHTMLTable = Server.CreateObject("IISSample.htmlTbl")
  45.   oHtmlTable.Borders = True
  46.   oHtmlTable.Caption = "<b>Authors of These Samples</b>"
  47.   oHtmlTable.CaptionStyle = "align=left"
  48.   oHtmlTable.AutoFormat(RecSet)
  49.  
  50.   RecSet.close
  51.   oConn.close
  52. %>
  53.  
  54. </BODY>
  55.  
  56. </HTML>
  57.