[此贴子已经被作者于2005-9-9 10:49:16编辑过]
[此贴子已经被作者于2005-9-9 10:49:16编辑过]
t1.asp [QUOTE] <!--#include file="conn.asp"--> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <% set rs=server.CreateObject("adodb.recordset") sql="select * from bbs" rs.open sql,conn,3,2
%> <form name="form1" method="post" action="t2.asp"> <%for each x in rs.fields %> <input type="checkbox" name="aa" value="<%=x.name %>"><%= x.name %> <%next %> <input type="submit" name="Submit" value="提交"> </form> [/QUOTE] t2.asp [QUOTE]<% aa=request.Form("aa") set rs=server.CreateObject("adodb.recordset") if aa<>"" then sql="select "&aa&" from bbs" else sql="select * from bbs" end if rs.open sql,conn,3,2 %> <table width="600" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <% for each x in rs.fields %> <td><%=x.name%></td> <% next %> </tr> <% do while not rs.eof %> <tr> <% for each x in rs.fields %> <td><%=x.value %></td> <% next %> </tr> <% rs.movenext loop %> </table>[/QUOTE] 把表名改一下可以了!