如果你的数据源为:user,数据库中的一个表为:users
可以这个样:
<%
set obj=createobject("ADODB.Connection")
obj.open"dsn=user;"
sql="Select * from users"
set rs=createobject("ADODB.recordset")
rs.open sql,obj,1,1
response.write "<table align=center width=1200 border='1'>"
response.write "<tr>"
for i=0 to rs.fields.Count-1
response.write "<td align=center width=500 height=30>"&rs.fields(i).name&"</td>"
next
response.write "</tr>"
do while(not rs.eof)
response.write "<tr>"
for i=0 to rs.fields.Count-1
response.write "<td align=center width=500 height=30>"&rs.fields(i).Value&"</td>"
next
response.write "</tr>"
rs.MoveNext
loop
response.write "</tr>"
response.write "</table>"
rs.close
set rs=nothing
obj.close
set obj=nothing
%>