2014/2/6 17:41:471960 閱讀
Set rs=Server.CreateObject("ADODB.Recordset")
Sql="select * from ["&banj&"] where 姓名=’"&xm&"’"
rs.open sql,Conn,1,1
if rs.bof and rs.eof then
Response.Write "沒找到您要查詢的數(shù)據(jù),請確認姓名和班級是否正確<a href=’./’>返回繼續(xù)查詢</a> "
Response.End
else
Response.Write"您查詢的結果如下:<hr><br>"
end if
j=rs.Fields.count
Response.Write"<table width=100% border=1 cellspacing=0 cellpadding=5 bordercolor=’#999999′>"
‘字段輸出
For i=2 to (j-1)
‘從2開始是省掉id及不必要的數(shù)據(jù)
Response.Write("<th>" & rs.Fields(i).Name & "</th>")
Next
‘數(shù)據(jù)輸出
Do while not Rs.Eof
temp = "<tr>"
For n = 2 to j – 1
‘同上
temp = temp & "<td> " & rs.Fields(n).Value & "</td>"
Next
Response.Write temp & "</tr>"
rs.movenext
Loop
微信小程序
掃描手機瀏覽