How to dynamically create a HTML table from an ADO recordset !.
Shows how to dynamically create a HTML table from a recordset. All you need is the connection string and the table name.
Original Author: iNet1
Code
**********************************************************************
How to dynamically create a html table from an ADO recordset !.
All you need is your connection string and Table name, and
off you go !.
**********************************************************************
<%
Dim conn
Dim cmd
Dim rs
Set conn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = "Provider = MSDASQL;Data Source=Northwind;Database=Northwind;User Id=;Password=;"
cmd.CommandText = "SELECT * FROM Customers"
Set rs = cmd.Execute
Response.Write ""
"
Response.Write "" "
for i = 1 to rs.Fields.Count - 1
Response.Write "" & rs.Fields(i).Name & " "
next
Response.Write "
Do While Not rs.EOF
Response.Write "" "
for i = 1 to rs.Fields.Count - 1
Response.Write "" & rs.Fields(i) & " "
next
rs.MoveNext
Response.Write "
Loop
Response.Write "
%>
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.