Return to Snippet

Revision: 9729
at November 19, 2008 05:24 by ginoplusio


Initial Code
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")	
Conn.Open Application("ConnectionString")
Dim temp
Dim i
temp =0
response.write "<table>"
do while not rst.eof
		For i = 0 To rst.fields.count - 1
			If temp = 0 Then
				If i = 0 then response.write "<tr><td></td>"
				response.write "<th>" & rst(i).name & "</th>"
				If i = rst.fields.count - 1 then response.write "</tr>"
			End If
		Next
		For i = 0 To rst.fields.count - 1
			If i = 0 then response.write "<tr><td>" & temp & "</td>"
			response.write "<td>" & rst(i)
			response.write("</td>")
			If i = rst.fields.count - 1 then response.write "</tr>"
		Next
		temp = temp + 1	
	rst.movenext
loop
response.write "</table>"
rst.close
set rst=nothing
%>

Initial URL
http://www.barattalo.it/

Initial Description
show a table with data and his column name

Initial Title
ASP show a sql table

Initial Tags
sql, table, ASP

Initial Language
ASP