數據庫文件也是根據您的要求制作的。如果您還沒有建立它,請下載它:
,rs,sql,th,tbody
如果request("sel") = "xx ",則
SQL = " select * from xsxx where student number = " &;請求(“sid”)
elseif request("sel") = "cj "然後
SQL = " select * from xscj where student number = " &;請求(“sid”)
如果…就會結束
set cn = server . createobject(" adodb . connection ")
set RS = server . createobject(" adodb . recordset ")
cn.open "provider=Microsoft。Jet . OLEDB.4.0Jet OLEDB:數據庫密碼= 123;數據源= " & amp服務器。MapPath("xsk.mdb ")
set rs = cn.execute( sql)
th = " "
tbody = " "
如果rs。那麽EOF
tbody = " & lttd & gt對不起,這個學號不存在
如果…就會結束
而不是rs。文件結束
tbody = tbody & amp“& lttr >;
對於i = 0至rs。字段。計數- 1
th = th & amp“& ltTD >;& amprs。字段(壹)。姓名和名稱。“& lt/TD >;
tbody = tbody & amp“& ltTD >;& amprs。字段(壹)。價值與價值。“& lt/TD >;
然後
tbody = tbody & amp“& lt/tr >;
rs。下壹步
行
cn .關閉
設置cn =無
% & gt
& lthtml & gt
& ltbody & gt
& lthead & gt
& ltstyle & gt
td{padding:0 20px}
& lt/style & gt;
& lt/head & gt;
& lt表& gt
& ltth & gt& lttr & gt& lt% = th % & gt& lt/tr & gt;& lt/th & gt;
& lttbody & gt& lt% = tbody % & gt& lt/tbody & gt;
& lttfoot & gt& lttd & gt& lta href = ' JavaScript:window . history . back();'& gt返回
& lt/table & gt;
& lt/body & gt;
& lt/html & gt;