%@ LANGUAGE = JScript %>
Query to Fill HTML Table (using ADO Table Component)
Query to Fill HTML Table (using ADO Table Component)
<%
var oConn; // The connection object
var SQLstatement;
var RecSet; // The record set returned
var oHTMLTable; // The HTML Table Formatter object
var iRows; // The place holder for the number of rows returned in the record set
oConn = Server.CreateObject("ADODB.Connection");
// You must first create the file DSN for this sample to look at.
// This SDK comes with an authors.mdb in the same directory as this file
// Go to Control Panels | ODBC | File DSN
// Select Add and Microsoft Access Driver (*.mdb)
// Name the DSN "Authors.dsn" and point it to the authors.mdb
oConn.Open("FILEDSN=Authors.dsn");
SQLstatement = "SELECT * From Authors";
RecSet = oConn.Execute(SQLstatement,iRows);
// This sample does NOT include the HTMLTable object. You will need to get this
// component from the Microsoft Web Site. Follow the installation instructions
// which come with the component to install the component.
oHTMLTable = Server.CreateObject("IISSample.htmlTbl");
oHTMLTable.Borders = true;
oHTMLTable.Caption = "Authors of These Samples";
oHTMLTable.CaptionStyle = "align=left";
oHTMLTable.AutoFormat(RecSet);
RecSet.close();
oConn.close();
%>