问题太好解决,想要分的请进!

jzzlpat 2003-09-22 02:13:15
<script>
function gg()
{
if (isNaN(document.mm.mypage.value)&&document.mm.mypage.value!="")
{alert("页码为非数值数据!!!");
return(false);
}
return(true);

}

</script>





<table width="100%" height="525" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="525" valign="top"> <table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="585" height="135" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%
mypagesize=9
mypage=request.querystring("mypage")
num=request.querystring("num")




if num="" then
num=10
end if
num=cint(num)

if mypage="" or mypage<=0 then
mypage=1
end if
if cint(mypage)>=num then
mypage=num
end if

set rs=server.createobject("adodb.recordset")
lb1=trim(request.querystring("lb"))



rs.cursorlocation=3
sql="select * from product where lb='" & lb1 & "'"
rs.open sql,conn
rs.pagesize=mypagesize

num=rs.pagecount
if cint(mypage)<=num then
rs.absolutepage=mypage
end if

if rs.eof then
%>
<%end if
i=0
do while not rs.eof and i<mypagesize
i=i+1
%>
<td width="90"> <div align="center"></div>
</td>
<td width="91"><div align="center"><a href="viewshow.asp?id=<%=rs("id")%>" target="_blank"><img src="admin/<%=rs("url")%>" width="130" height="110" border="1"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><font color="#FF0000" size="2">    <a href="viewshow.asp?id=<%=rs("id")%>">
<%=rs("name")%></a></font></div></td>
</tr>
</table>
<font color="#FF0000" size="2"><br>
</font></div></td>
<td width="76"> </td>
<%
if (i mod 3=0) and i>=3 then
%>
</tr>
<tr>
<%
end if

rs.movenext
loop
rs.close
%>
</tr>
</table>

<form method="get" action="view.asp" name="mm" onsubmit="return gg()" >
<p align="right"> <font color="#00000" size="2"><%=mypage%>/<%=num%> 

<input type="text" name="mypage" size="3">
页  
<% if mypage-1>=1 then %>
<a href="view.asp?num=<%=num%>&mypage=<%=mypage-1%>" >[上一页]</a>
<% end if %>
<% if cint(mypage)<num then %>
<a href="view.asp?num=<%=num%>&mypage=<%=mypage+1%>" >[下一页]</a>
</font> <font color="#030303" size="2">
<% end if %>
</font> </form>




这个翻页为什么不好用??????????请给我指点一下!


方便的话,请留下QQ或MSN。
...全文
49 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
超级大笨狼 2003-09-22
  • 打赏
  • 举报
回复
自己看去吧

<%
dim j,mypage

j=1
Rs.PageSize=15
page=cint(request("page"))
if page<1 then
page=1
end if
if page>Rs.PageCount then
page=Rs.PageCount
end if




%>
<table width="85%" border="1" cellpadding="1" cellspacing="0" bordercolor="#339933" align="center">
<tr bgcolor="#255421">
<td width="38%" height="30" align="center"> <strong><font color="#cccccc">药
品</font><font color="#cccccc"> 名 称 </font></strong></td>
<td width="16%" height="30" align="center"> <strong><font color="#cccccc">门诊规格
</font></strong></td>
<td width="12%" height="30" align="center"> <strong><font color="#cccccc">计量</font><font color="#cccccc">单位
</font></strong></td>
<td width="13%" height="30" align="center"> <strong><font color="#cccccc">门诊</font><font color="#cccccc">单价
</font></strong></td>
<td width="21%" height="30" align="center"> <strong><font color="#cccccc">报销类型
</font></strong></td>
</tr>
<%
if Rs.RecordCount >0 then
Rs.AbsolutePage=Page
for j=1 to Rs.PageSize

%>
<tr bgcolor="#3E8C37">
<td align="left" valign="middle" nowrap><font color="#ffffff">
<strong>  <%=server.HTMLEncode(rs("name"))%> </strong></font></td>
<td align="left" valign="middle" nowrap bgcolor="#3E8C37"><font color="#ffffff">
<strong>   <%=server.HTMLEncode(rs("gg_mz"))%></strong></font></td>
<td align="center" valign="middle" nowrap bgcolor="#3E8C37"><font color="#ffffff">
<strong><%=server.HTMLEncode(rs("recipunit"))%></strong> </font></td>
<td align="right" valign="middle" nowrap bgcolor="#3E8C37"><font color="#ffffff">
<strong><%=FormatNumber(rs("basicprice")*rs("reciptrans")/rs("storetrans"),2,-1)%>元 </strong>
</font></td>

<td align="center" valign="middle" nowrap><font color="#ffffff"> <strong>
<%
select case rs("flag")
case 0
Response.Write "完全可报销"
case 1
Response.Write "不可报销"
case 2
Response.Write "70%可报销"
end select
%></strong>
</font></td>


</tr>
<%

Rs.MoveNext
if Rs.EOF then exit for
next
end if
%>
</table>

<%if rs.recordcount>15 then %>
<table width="85%" height="40" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#339933" bgcolor="#255421" class="unnamed1">
<tr>
<td width="100" align="center" ><img onClick="vbs:call aaa(1,'<%=alpha%>')" src="images/DoctorIntro/First copy.gif" width="51" height="34"></td>
<td width="100" align="center" ><img onClick="vbs:call aaa(<%=(cint(page)-1)%>,'<%=alpha%>')" src="images/DoctorIntro/previos copy.gif" width="51" height="34"></td>
<td width="100" align="center" ><img onClick="vbs:call aaa(<%=(cint(page)+1)%>,'<%=alpha%>')" src="images/DoctorIntro/Next copy.gif" width="51" height="34"></td>
<td width="100" align="center" >
<img onClick="vbs:call aaa(<%=Rs.PageCount%>,'<%=alpha%>')" src="images/DoctorIntro/Last copy.gif" width="51" height="34"></td>
<td width="100" align="center" ><font size="2">页码:<%=page%>/<%=Rs.PageCount%></font></td>
</tr>
</table>
<%end if%>
</td>
<td width="8%" height="372" valign="top">
超级大笨狼 2003-09-22
  • 打赏
  • 举报
回复
自己看去吧

<%
dim j,mypage

j=1
Rs.PageSize=15
page=cint(request("page"))
if page<1 then
page=1
end if
if page>Rs.PageCount then
page=Rs.PageCount
end if




%>
<table width="85%" border="1" cellpadding="1" cellspacing="0" bordercolor="#339933" align="center">
<tr bgcolor="#255421">
<td width="38%" height="30" align="center"> <strong><font color="#cccccc">药
品</font><font color="#cccccc"> 名 称 </font></strong></td>
<td width="16%" height="30" align="center"> <strong><font color="#cccccc">门诊规格
</font></strong></td>
<td width="12%" height="30" align="center"> <strong><font color="#cccccc">计量</font><font color="#cccccc">单位
</font></strong></td>
<td width="13%" height="30" align="center"> <strong><font color="#cccccc">门诊</font><font color="#cccccc">单价
</font></strong></td>
<td width="21%" height="30" align="center"> <strong><font color="#cccccc">报销类型
</font></strong></td>
</tr>
<%
if Rs.RecordCount >0 then
Rs.AbsolutePage=Page
for j=1 to Rs.PageSize

%>
<tr bgcolor="#3E8C37">
<td align="left" valign="middle" nowrap><font color="#ffffff">
<strong>  <%=server.HTMLEncode(rs("name"))%> </strong></font></td>
<td align="left" valign="middle" nowrap bgcolor="#3E8C37"><font color="#ffffff">
<strong>   <%=server.HTMLEncode(rs("gg_mz"))%></strong></font></td>
<td align="center" valign="middle" nowrap bgcolor="#3E8C37"><font color="#ffffff">
<strong><%=server.HTMLEncode(rs("recipunit"))%></strong> </font></td>
<td align="right" valign="middle" nowrap bgcolor="#3E8C37"><font color="#ffffff">
<strong><%=FormatNumber(rs("basicprice")*rs("reciptrans")/rs("storetrans"),2,-1)%>元 </strong>
</font></td>

<td align="center" valign="middle" nowrap><font color="#ffffff"> <strong>
<%
select case rs("flag")
case 0
Response.Write "完全可报销"
case 1
Response.Write "不可报销"
case 2
Response.Write "70%可报销"
end select
%></strong>
</font></td>


</tr>
<%

Rs.MoveNext
if Rs.EOF then exit for
next
end if
%>
</table>

<%if rs.recordcount>15 then %>
<table width="85%" height="40" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#339933" bgcolor="#255421" class="unnamed1">
<tr>
<td width="100" align="center" ><img onClick="vbs:call aaa(1,'<%=alpha%>')" src="images/DoctorIntro/First copy.gif" width="51" height="34"></td>
<td width="100" align="center" ><img onClick="vbs:call aaa(<%=(cint(page)-1)%>,'<%=alpha%>')" src="images/DoctorIntro/previos copy.gif" width="51" height="34"></td>
<td width="100" align="center" ><img onClick="vbs:call aaa(<%=(cint(page)+1)%>,'<%=alpha%>')" src="images/DoctorIntro/Next copy.gif" width="51" height="34"></td>
<td width="100" align="center" >
<img onClick="vbs:call aaa(<%=Rs.PageCount%>,'<%=alpha%>')" src="images/DoctorIntro/Last copy.gif" width="51" height="34"></td>
<td width="100" align="center" ><font size="2">页码:<%=page%>/<%=Rs.PageCount%></font></td>
</tr>
</table>
<%end if%>
</td>
<td width="8%" height="372" valign="top">
hfkj 2003-09-22
  • 打赏
  • 举报
回复
<script>
function gg()
{
if (isNaN(document.mm.mypage.value)&&document.mm.mypage.value!="")
{alert("页码为非数值数据!!!");
return(false);
}
return(true);

}

</script>





<table width="100%" height="525" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="525" valign="top"> <table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="585" height="135" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%
dim mypagesize,mypage,num
mypagesize=9
mypage=request.querystring("mypage")
num=request.querystring("num")




if num="" then
num=10
end if
num=cint(num)

if mypage="" or mypage<=0 then
mypage=1
end if
if cint(mypage)>=num then
mypage=num
end if

set rs=server.createobject("adodb.recordset")
lb1=trim(request.querystring("lb"))



rs.cursorlocation=3
sql="select * from product where lb='" & lb1 & "'"
rs.open sql,conn
rs.pagesize=mypagesize

num=rs.pagecount
if cint(mypage)<=num then
rs.absolutepage=mypage
end if

if rs.eof then
%>
<%
i=0
do while not rs.eof and i<mypagesize
i=i+1
%>
<td width="90"> <div align="center"></div>
</td>
<td width="91"><div align="center"><a href="viewshow.asp?id=<%=rs("id")%>" target="_blank"><img src="admin/<%=rs("url")%>" width="130" height="110" border="1"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><font color="#FF0000" size="2">    <a href="viewshow.asp?id=<%=rs("id")%>">
<%=rs("name")%></a></font></div></td>
</tr>
</table>
<font color="#FF0000" size="2"><br>
</font></div></td>
<td width="76"> </td>
<%
if (i mod 3=0) and i>=3 then
%>
</tr>
<tr>
<%
end if

rs.movenext
loop
rs.close
%>
</tr>
</table>

<form method="get" action="view.asp" name="mm" onsubmit="return gg()" >
<p align="right"> <font color="#00000" size="2"><%=mypage%>/<%=num%> 

<input type="text" name="mypage" size="3">
页  
<% if mypage-1>=1 then %>
<a href="view.asp?num=<%=num%>&mypage=<%=mypage-1%>" >[上一页]</a>
<% end if %>
<% if cint(mypage)<num then %>
<a href="view.asp?num=<%=num%>&mypage=<%=mypage+1%>" >[下一页]</a>
</font> <font color="#030303" size="2">
<% end if %>
</font> </form>
jzzlpat 2003-09-22
  • 打赏
  • 举报
回复
现在有200条数据,但只显示9条,点下页之后根本就不显示其他的191条!

没有数据就算了,点回上一页就出错了!

错误类型:
ADODB.Recordset (0x800A0BB9)
/view.asp, 第 131 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

页:
GET /view.asp

时间:
2003年9月22日, 14:18:17


rs.absolutepage=mypage 这个是131行!
不老书生 2003-09-22
  • 打赏
  • 举报
回复
怎么不好用了,报什么错了?
jzzlpat 2003-09-22
  • 打赏
  • 举报
回复
在这个基础上改一下!我实在是找不到原因了!
yangsm 2003-09-22
  • 打赏
  • 举报
回复
有点儿不懂你的意思,是要重找一份,还是……

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧