标题:[求助]关于ASP分页
取消只看楼主
cuijie_cj
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-11-8
 问题点数:0 回复次数:0 
[求助]关于ASP分页

大家好,我是个菜鸟,刚做了个简单的asp 程序
第一页就可以正常显示,可后面的页面就无法显示出來!
晕!
代码如下,请各位大侠帮我看看!先谢了!

set cnn = server.CreateObject("ADODB.Connection")
set rst = server.CreateObject("ADODB.Recordset")
cnn.ConnectionString = "Driver={SYBASE SYSTEM 11};Srvr=123456;Uid=aaa;Pwd=aaaaaa;database=ddd;"
cnn.open
rst.CursorLocation = 3
rst.CursorType = 1
rst.PageSize = 25
currentPage = request.QueryString("currentPage")
rst.absolutePage = currentPage
if currentPage = "" then
currentPage = 1
else
currentPage = cint(currentPage)
end if
v_select = request.Form("select_v")
fdate_st = trim(request.Form("mytimest"))
fdate_ed = trim(request.Form("mytimeed"))
trno_t = trim(request.Form("t_trno"))
if fdate_st = "" and fdate_en = "" and trno_t = "" and v_select = "all" then
sSQL = "select * from servisit order by fdate DESC"
end if
rst.open sSQL,cnn,1,1
If rst.RecordCount=0 then
response.Write "<P><font color = red>没有找到符合条件的记录!</font></p>"
else
rst.AbsolutePage = CLng(Request("CurrentPage"))
rowcount = 0
%>
<td colspan="3" borderColorLight=#4e9b00 align=middle borderColorDark=#ffffff height=18><div align="center">查询结果:
<% = rst.RecordCount %>
条记录</div></td>
</tr>
</table>
<p align="center">每页<% = rst.pagesize %>条记录&nbsp;&nbsp;当前页次: <% = currentPage %>/<% = rst.pagecount %>&nbsp;
<%
for i = 1 to rst.pagecount
if i = CInt(currentPage) then %>
[<font color="#FF0000"><% = i %></font>]&nbsp;&nbsp;
<% else %>
[<a href="browseinfo.asp?currentPage=<% = i %>"><% = i %></a>]&nbsp;&nbsp;
<%
end if
next
end if
rst.close
Set rst=nothing
%>
</p>
</body>
</html>

[此贴子已经被作者于2007-11-13 11:48:29编辑过]

2007-11-13 11:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-185725-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.358349 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved