25 lines
638 B
Plaintext
25 lines
638 B
Plaintext
|
SQL = "SELECT * FROM MyTable"
|
||
|
Set Conn = Server.CreateObject("ADODB.Connection")
|
||
|
Conn.Open Application("ConnectionString")
|
||
|
Set RS = Server.CreateObject("ADODB.Recordset")
|
||
|
RS.Open SQL, Conn
|
||
|
fCount = RS.Fields.Count - 1
|
||
|
Response.Write "<table border=1><tr bgcolor='#EEEEEE'>"
|
||
|
for i=0 to fCount
|
||
|
Response.Write "<th>" & RS(i).name & "</th>"
|
||
|
next
|
||
|
Response.Write "</tr>"
|
||
|
While Not RS.EOF
|
||
|
Response.Write "<tr>"
|
||
|
for i=0 to fCount
|
||
|
Response.Write "<td>" & RS(i).value & "</td>"
|
||
|
next
|
||
|
Response.Write "</tr>
|
||
|
RS.MoveNext
|
||
|
Wend
|
||
|
Response.Write "</table>"
|
||
|
RS.Close
|
||
|
Set RS = Nothing
|
||
|
Conn.Close
|
||
|
Set Conn = Nothing
|