<%@ LANGUAGE="vbscript" %> <%Option Explicit%> <% '------------------------------------------------------------------------------- 'Aawsom Technologies 'Created By: Steve Hunsader 'Created On: 2/8/02 '------------------------------------------------------------------------------- 'Defining Objects Dim sTableName Dim Products, rsProducts 'These should be renamed for each project Dim sQuery, cmdTemp, nFields, ThisRecord, i 'insert table name sTableName = "Products" 'If a Query String item "T" exists, then display that table instead. If trim(Request.QueryString("T")) <> "" then sTableName = trim(Request.QueryString("T")) End If sQuery = "SELECT * FROM " & sTableName 'Connection Object to database Set Products=Server.CreateObject("ADODB.Connection") Products.ConnectionTimeout = Session("ConnectionTimeout") Products.CommandTimeout = Session("CommandTimeout") Products.Open Session("ConnectString"), Session("RuntimeUser"), Session("RuntimePass") Set cmdTemp = Server.CreateObject("ADODB.Command") Set rsProducts = Server.CreateObject("ADODB.Recordset") cmdTemp.CommandText = sQuery cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = Products rsProducts.Open cmdTemp, , 0, 1 'Response.Write sQuery %> Table <%=sTableName%>
Table <%=sTableName%>

<%'Header On The Table of Field Names%> <%nFields=rsProducts.fields.count -1%> <%For i=0 to nFields%> <%Next%> <%' Loop through the records%> <%Do While NOT rsProducts.EOF%> <%For i = 0 to nFields ThisRecord = rsProducts(i) If IsNull(ThisRecord) Then ThisRecord = " " End If%> <%Next%> <%rsProducts.movenext%> <%Loop%>
<%=rsProducts(i).name%>
<%=ThisRecord%>