大家来找茬

l07162220 2008-11-27 03:16:14
请大家帮忙看看这段分页代码的问题 请问是分页写的有问题还是怎么了 始终拿不到值

有时候报连接关闭的错 有时候又报ASP 0113 (0x80004005) 连接超时的错
<!--#include file="./conn.asp" -->
<html>
<head>
<title>Join UCLEF</title>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css/eStyle_china.css" rel="stylesheet" type="text/css">
<link href="../css/css.css" rel="stylesheet" type="text/css">

</head>
<body><center>

<table width="1000" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="180" align="center" valign="top" bgcolor="#EFEFEF" >
<table width="180" border="0" cellspacing="0" cellpadding="0" >
<tr >
<td height="30" background="../images/LeftNavBg.gif" align="center"><span class="LeftTitle1">Membership </span></td>
</tr>
<tr>
<td>
<table width="180" height="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td align="center" valign="top" >
<table width="180" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="18"></td>
</tr>
</table>

<table width="164" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"></td>
</tr>
<tr>
<td id="textindent" height="27" background="../images/zuodhditu.gif"><A HREF="membermanage.asp">The Rights of Members</A></td>
</tr>
</table>

<table width="164" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"></td>
</tr>
<tr>
<td id="textindent" height="27" background="../images/zuodhditu.gif"><A HREF="membermanage.asp"><B>Membership Types</B> </A></td>
</tr>
</table>

<table width="164" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"></td>
</tr>
<tr>
<td id="textindent" height="27" background="../images/zuodhditu.gif"><A HREF="membermanage.asp">Dues Waiver Program</A></td>
</tr>
</table>


<table width="164" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"></td>
</tr>
<tr>
<td id="textindent" height="27" background="../images/zuodhditu.gif"><A HREF="membermanage.asp">Membership Application </A></td>
</tr>
</table>

</td>
</tr>
</table></td>
</tr>
</table>
<br>
</td>
<td width="780" align="center" valign="top">

<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0" background="../images/NavBg.gif">
<tr>
<td width="3" bgcolor="#e9e8e8"></td>
<td>    <img src="../images/jian2.gif"> <a href="../eindex.htm">Home</a> > Membership </td>
</tr>
</table>


<form name=form1 method="post">

<table width="800" border="1" cellspacing="0" cellpadding="6" bordercolor="#999999" bordercolordark="#ffffff" align=center>
<tr align='center'>

<TD colspan="10" align=left>Member Manage</a></TD>
</tr>
<TR class="tabletitlebg" align=center>

<TD width=30>choose</TD>
<TD width=80>First Name</TD>
<TD width=80>Last Name</TD>

</TR>

<%

dim currentPage,totalPage,totalCount,perPageCount,tmpCount,perLineCount,tmpLineCount
set rs=Server.CreateObject("adodb.recordset")

rs.Open "select count(*) as num from memberinfo",conn,1,3
totalCount = rs(0)
rs.close
set rs=nothing

currentPage=trim(request("page"))
perPageCount = 10 '每页显示的条数
perLineCount = 1 '每行显示的条数
tmpLineCount = 3
if currentPage="" then
currentPage=1
else
currentPage=Cint(currentPage)
end if

set rs=Server.CreateObject("adodb.recordset")
dim tmpsql,tmpform,tmptotalcount
tmpform = "memberinfo"
tmptotalcount = (currentPage-1)*perPageCount
if currentPage=1 then
tmpsql = "select top " & perPageCount & " * from " & tmpform & " order by id"
else
tmpsql = "select top " & perPageCount & " * from " & tmpform & " where memberid not in (select top " & tmptotalcount & " memberid from " & tmpform & " order by memberid) order by memberid"
end if
rs.Open tmpsql,conn,1,3


totalPage = totalCount\perPageCount

if (totalCount/perPageCount)<>0 then
totalPage = totalPage + 1
end if

if rs.RecordCount=0 then
response.write "<tr><td colspan='9'><br>nothing<br></td></tr>"
response.write "<td width=80>" & rs("lastname")& " </td>"
end if

do while not rs.eof
Response.Write"<td><INPUT type=checkbox name='delid' value='" & rs("memberid")&"'></td>"
Response.Write"<td width=80>" & rs("lastname")& " </td>"
Response.Write"<td width=150>" & rs("fistname")& " </td>"

rs.movenext
tmpCount=tmpCount+1
if tmpCount>=perPageCount then exit do
loop

rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<tr>

<td colspan="9">
<table width="100%%" border="0">
<tr class="bgFill" align="center">
<td width="27%" align="left"> 第 <%=currentPage%>页
  
共<%=totalPage%> 页

</td>
<td width="73%">
<div align="right">
<%
if currentPage<>1 then
%>
<button id="<%=currentPage-1%>" class="keybutton" onClick="goNext(this.getAttribute('id'),'<%= key %>');">上一页</button>
<% end if %>
<%if currentPage<>totalPage then %>
<button id="<%=currentPage+1%>" class="keybutton" onClick="goNext(this.getAttribute('id'),'<%= key %>');">下一页</button>
<% end if %>
</div>
</td>
</tr>
<INPUT id=totalpagenum type=hidden value=3 name=totalpagenum>
<INPUT id=nowpagenum type=hidden value=0 name=nowpagenum>
</table>
</td>
</tr>
</TABLE>
<table width="95%" align=center >
<tr>
<td width="20%" height="18" class="tabletdhead" align=left colspan="9">
<input type="button" name="Submit" value=" 新 增 " class="button1" >    
<input type="button" name="Submit" value=" 删 除 " class="button1" >    
</td>
<td height="18" class="tabletdhead" colspan=9 align=right> 

</td>
</tr>

</table>
</form>
</body>
</html>
...全文
73 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
Linzhe423 2008-11-29
这也太长了吧.,.
眼花
回复
不耐烦 2008-11-28
没耐心看完~
回复
wangkk125 2008-11-28
你们强
这么长也看得完
回复
hebhd 2008-11-28
另外.同一页内最好不要使用同名的 rs
可以将第二个rs 改成 rs1 或 rs2

还有就是你的记数 不知道你的数据库内有多少条记录.

会不会因为记录数太多导致超时 因为你有不加条件的统计
回复
hebhd 2008-11-28
哥们.你的goNext函数在哪里?
回复
xiaotuzi 2008-11-27
代码太长,又没有数据库及数据,怎么看啊....

你这样,使用asp传说中的屠龙刀 visual interdev,逐行调试,看看哪里的值不对了,立刻就明白了.
回复
l07162220 2008-11-27
没人理我。。。。。。。。。。。
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-11-27 03:16
社区公告
暂无公告