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

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