刚才忘了传了,现在好了,大家讨论一下看问题出在哪了,谢谢
select::
<form id="form1" name="form1" method="post" action="selectlist.asp">
<label>选择数据库
<select name="select">
<option value="links">连接</option>
</select>
</label>
<input type="submit" name="submit" value="确定">
</form>
selectlist:
<!--#include file="conn/conn.asp"-->
<!--#include file="select.asp"-->
<%
'dim tabletname
'TableName=Request("Select")
session("tablename")=Request("Select")
'response.write session("tablename")
'tablename=session("tablename")
exec="select * from "&session("tablename")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
rs.PageSize=30
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then
page=1
end if
rs.AbsolutePage=page
%>
<table border="1" cellspacing="0" cellpadding="0" align="center" class="thin" bordercolor="bule">
<tr bgcolor="#C6DCDB" class=fontlz>
<%for j=0 to rs.fields.count-1%>
<td><%=rs(j).name%></td>
<%next%>
</tr>
<%for i=1 to rs.PageSize%>
<%if rs.EOF then
exit for
end if%>
<tr <%if i mod 2=0 then response.write "bgcolor=#C6DCDB" end if%> class=fontlz>
<%for k=0 to rs.fields.count-1%>
<td><%=rs(k)%></td>
<%next%>
</tr>
<%rs.movenext
next
%>
<tr><td align="center" class="fontlz">总共<%response.write rs.recordcount%>条</td>
<td colspan=<%=rs.fields.count%> align=right class="fontlz">
<%if page=1 and not page=pagecount then%>
<div align="right">第<%=page%>页<%for i=1 to pagecount%>
<a href="selectlist.asp?page=<%=i%>"><%=i%></a><%next%>
<a href="selectlist.asp?page=<%=page+1%>">下一页</a></div>
<%elseif page=pagecount and not page=1 then%>
<div align="right">第<%=page%>页;<%for i=1 to pagecount%>
<a href="selectlist.asp?page=<%=i%>"><%=i%></a><%next%>
<a href="selectlist.asp?page=<%=page-1%>">上一页</a></div>
<%elseif page<1 then%><div class="font" align="right"><font color=red>没有任何记录!</font></div>
<%elseif page>pagecount then%><div class="font" align="right"><font color=red>没有任何记录!</font></div>
<%elseif page=1 and page=pagecount then%>
<%else%>
<div align="right">第<%=page%>页<%for i=1 to pagecount%>
<a href="selectlist.asp?page=<%=i%>"><%=i%></a><%next%>
<a href="selectlist.asp?page=<%=page-1%>">上一页</a>
<a href="selectlist.asp?page=<%=page+1%>">下一页</a>
</div>
<%end if%>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
[此贴子已经被作者于2006-8-16 21:25:41编辑过]