<!--metadata type="typelib" file="c:\program files\common files\system\ado\msado15.dll"-->
<% 
Set conn = Server.CreateObject("ADODB.Connection")
strProvider = "Provider=SQLNCLI;Data Source=MICROSOF-3A17C9\SQLEXPRESS;Initial Catalog=person;Integrated Security=SSPI; "
conn.Open strProvider
Command = "select * from t_teacher"
Set rs = conn.Execute(command,recordsAffected,adcmd)
'把查询得到的结果输出到表中
Response.Write "<TABLE border=3>"
'表头
Response.Write "<TR>"
For i=0 To rs.fields.count-1
    Response.Write "<TD>"&Ucase(rs(i).Name)&"</TD>"
Next
Response.Write "</TR>"
'把查询结果填入表中
While not rs.EOF
     Response.Write "<TR>"
     For i=0 To rs.fields.count-1
         Response.Write "<TD>"&rs(i).value&"</TD>"
     Next
     rs.MoveNext
     Response.Write "<TR>"
Wend
Response.Write "</TABLE>"
Set conn = nothing
%>
