建站代码网

热门标签

显示表格(由表格变量超链接排序)

一个用户想要/需要看到的棘手的任务的排序数据的方式,但是这不需要。利用Hall of Famer Hammerin' Hank Greenberg of the Detroit Tigers事业数据库下面的脚本会展现怎样显示由表格变量超链接排序的数据库。SQL语句是由用户输入也会显示在输入里面的动态生成的。

<% u_order=request.querystring("u_order") %> <% select case u_order case "year","team","avg","ab","r","h","double","triple","hr","rbi","bb","so","sb" %> <% case else response.redirect "table_order.asp?u_order=year" end select %> <% accessdb="greenberg" cn="DRIVER={Microsoft Access Driver (*.mdb)};" cn=cn & "DBQ=" & server.mappath(accessdb) Set rs = Server.CreateObject("ADODB.Recordset") sql = "select * from hammerin_hank order by "& u_order &" desc;" response.write sql rs.Open sql, cn %> <html> <body link="#0000FF" vlink="#0000FF" alink="#0000FF"> <div align="center"> <center> <TABLE BORDER="0" BGCOLOR="#ffffff" CELLSPACING="0" width="640"> <THEAD> <TR> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=year">Year</a></FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=team">Team</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=avg">AVG</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=ab">AB</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=r">R</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=h">H</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=double">2B</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=triple">3B</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=hr">HR</FONT></TH> <TH valign="top" align="left" width="49"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=rbi">RBI</FONT></TH> <TH valign="top" align="left" width="50"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=bb">BB</FONT></TH> <TH valign="top" align="left" width="50"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=so">SO</FONT></TH> <TH valign="top" align="left" width="50"><FONT SIZE="1" FACE="Arial"><a href="table_order.asp?u_order=sb">SB</FONT></TH> </TR> </THEAD> <TBODY> <% On Error Resume Next rs.MoveFirst do while Not rs.eof %> <TR VALIGN=TOP> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("Year") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("Team") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("AVG") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("AB") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("R") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("H") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("Double") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%= rs("Triple") %> </FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("HR") %></FONT></TD> <TD ALIGN="left" valign="top" width="49"><FONT SIZE="1" FACE="Arial"><%=rs("RBI")%></FONT></TD> <TD ALIGN="left" valign="top" width="50"><FONT SIZE="1" FACE="Arial"><%=rs("BB") %></FONT></TD> <TD ALIGN="left" valign="top" width="50"><FONT SIZE="1" FACE="Arial"><%=rs("SO") %></FONT></TD> <TD ALIGN="left" valign="top" width="50"><FONT SIZE="1" FACE="Arial"><%=rs("SB") %></FONT></TD> </TR> <% rs.MoveNext loop%> </TBODY> <TFOOT></TFOOT> </TABLE> </center> </div> </BODY> </HTML>


热门信息

X