日期:2014-05-17 浏览次数:20523 次
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("db/data.mdb")
set rs=conn.Execute("Select * from cm100")
Response.Write "<table border=1>"
While Not rs.EOF
Response.Write "<tr>"
For i = 1 To 3
If rs.EOf Then
Response.Write "<td> </td><td> </td>"
Else
Response.Write "<td>" & rs("mingcheng") & "</td>" //应该怎样给显示的名字加链接
Response.Write "<td>" & rs("xingbie") & "</td>"
rs.MoveNext
End If
Next
Response.Write "</tr>"
Wend
Response.Write "</table>"
%>
5678910111213141516171819202122
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open Server.MapPath("db/data.mdb")set rs=conn.Execute("Select * from cm100 where sex='男'")//这里加一个取数据条件过滤即可。 Response.Write "<table border=1>"While Not rs.EOF Response.Write "<tr>" For i = 1 To 3 If rs.EOf Then Response.Write "<td> </td><td> </td>" Else Response.Write "<td><a href='要跳到的地址'>" & rs("mingcheng") & "</a></td>" //应该怎样给显示的名字加链接 Response.Write "<td>" & rs("xingbie") & "</td>" rs.MoveNext End If NextResponse.Write "</tr>"Wend Response.Write "</table>"%>