DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: cqfighterli
今日帖子: 19
在线用户: 8
导航: 论坛 -> 网站意见 斑竹:zizii,sunyesy  
作者:
男 xyj_hdy (flashbear) ★☆☆☆☆ -
普通会员
2004/2/18 19:00:27
标题:
分页显示的问题~ 浏览:1431
加入我的收藏
楼主: 分页显示的问题~

<%@ language="VBSCRIPT" %>
<%
option Explicit
Response.Expires=0
%>
<!--#include file="adovbs.inc"-->
<%
const intPageSize=10
Dim intCurrentPage,objConn,objRS,strQ,StrConn
Dim intTotalPages,IntI
If Request.ServerVariables("CONTENT_LENGTH")=0 Then
intCurrentPage=1
Else
intCurrentPage=CInt(Request.Form("CurrentPage"))
Select Case Request.Form("Submit")
Case "Previous"
intCurrentPage=intCurrentPage-1
Case "Next"
intCurrentPage=intCurrentPage+1
End Select
End IF
Set objconn = Server.CreateObject("ADODB.Connection")
Strconn="DRIVER={Microsoft Access Driver (*.mdb)}; "
Strconn=Strconn & "DBQ=" & Server.MapPath("infor.mdb")
objconn.Open Strconn
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.CursorLocation=adUseClient
objRS.CursorType=adOpenStatic
objRS.CacheSize=intPageSize
strQ= "Select * "
strQ= strQ & "FROM computer "
objRS.open strQ,objConn
objRS.PageSize=intpageSize
If Not(objRS.EOF) Then objRS.AbsolutePage=intCurrentPage
intTotalPages=objRS.PageCount
%>
<HTML><BODY>
<b>Customer:orderDate</b><p>
<%
For inti=1 to objRS.PageSize
Response.Write Server.HTMLEncode(objRS("xinghao") & ":" & objRS("peizhi")) & "<br>"
objRs.MoveNext
IF objRS.EOF THEN Exit for
Next
objRS.Close:objConn.Close
Set objRS=Nothing:set objConn=nothing
%>
<br>
page<%=intCurrentPage%> of<% =intTotalPages %><p>
<form action="<%= Request.ServerVariables("Script_name") %>" method="post">
<input type="hidden" name="CurrentPage"
value="<%=intCurrentPage%>">
<%
If intCurrentPage>1 Then %>
<input type="submit" name="submit" value="previous">
<% End If
If intCurrentPage<>intTotalPages Then %>
<input Type="submit" name="submit" value="next">
<% End If %>
</form>
</body></html>
这是所有的代码,为什么点了next之后没反应?~ 

----------------------------------------------
-
作者:
男 xjr888 (arming) ★☆☆☆☆ -
盒子活跃会员
2004/2/23 21:15:12
1楼:  首先 case 里面用的是大写开头的Previous,Next;而 submit 的value 都是小写的,不知有没有问题,最好统一一下。
 另外,在 objRS.open strQ,objConn 后再加两个参数:
改为 objRS.open strQ,objConn,1,1  试一下。
  具体我没有试过,你看一下把,我以前就是这么做的。

----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行62.5毫秒 RSS