帮忙看看程序那里错了----ASP程序
<%dim action
action=request.QueryString("action")
%>
<table width="100%" height="287" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="STYLE1">
<td height="18" colspan="3" align="left" bgcolor="#FFCCFF"> <a href="manageorders.asp?action=yes">已处理订单</a> | <a href="manageorders.asp?action=no">未处理订单</a> | <a href="manageorders.asp?action=all">全部</a></td>
</tr>
<tr>
<td height="2" colspan="3" align="center"><hr align="center" width="100%" size="1"></td>
</tr>
<tr><td width="1238" height="20"> </td>
</tr>
<tr><form name="form1" method="post" action="">
<td height="150" colspan="3" align="center" valign="top">
<%
Const maxperpage=8
dim totalput
dim currentpage
if not isempty(request("page")) then
currentpage=Cint(request("page"))
else
currentpage=1
end if
set rs=server.CreateObject("adodb.recordset")
'rs.open "select * from orders",conn,1,1
select case action
case "all"
rs.open "select * from orders order by date desc",conn,1,1
case "yes"
rs.open "select * from orders where deal=1 order by date desc",conn,1,1
case "no"
rs.open "select * from orders where deal=0 order by date desc",conn,1,1
end select
if err.number<>0 then
response.Write("<div align=center>数据库中没有数据...</div>")
end if
if rs.eof And rs.bof then
response.Write("<div align=center>数据库中没有数据...</div>")
else
totalput=rs.recordcount
if currentpage< 1 then
currentpage=1
end if
if (currentpage-1)*maxperpage > totalput then
if (totalput mod maxperpage)=0 then
currentpage=totalput \ maxperpage
else
currentpage=totalput \ maxperpage+1
end if
end if
if currentpage=1 then
showContent
showPage totalput,maxperpage,"manageorders.asp"
else
if (currentpage-1)* maxperpage < totalput then
rs.move (currentpage-1)* maxperpage
dim bookmark
bookmark=rs.bookmark
showContent
showPage totalput,maxperpage,"manageorders.asp"
else
currentpage=1
showContent
showPage totalput,maxperpage,"manageorders.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<table width="100%" height="85" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" class="STYLE2">
<td width="68" height="30" bgcolor="#FFFFFF">订单号</td>
<td width="101" bgcolor="#FFFFFF">产品</td>
<td width="68" bgcolor="#FFFFFF">数量(吨)</td>
<td width="168" bgcolor="#FFFFFF">公司名称</td>
<td width="92" bgcolor="#FFFFFF">联系人</td>
<td width="114" bgcolor="#FFFFFF">电话</td>
<td width="201" bgcolor="#FFFFFF">地址</td>
<td width="150" bgcolor="#FFFFFF">E-Mail</td>
<td bgcolor="#FFFFFF">下定日期</td>
<td colspan="2" align="left" bgcolor="#FFFFFF"> 状态</td>
</tr>
<%
do while not rs.eof
'response.Write("<div align=center>数据库中没数据</div>")
'else
%>
<tr class="STYLE1" align="center">
<td height="24" bgcolor="#FFFFFF"><%=rs("orderid")%></td>
<td bgcolor="#FFFFFF"><%=rs("product")%></td>
<td bgcolor="#FFFFFF"><%=rs("num")%></td>
<td bgcolor="#FFFFFF"><%=rs("company")%></td>
<td bgcolor="#FFFFFF"><%=rs("username")%><%=rs("sex")%></td>
<td bgcolor="#FFFFFF"><%=rs("tel")%></td>
<td bgcolor="#FFFFFF"><%=rs("address")%></td>
<td bgcolor="#FFFFFF"><%=rs("email")%></td>
<td width="133" bgcolor="#FFFFFF"><%=rs("date")%></td>
<td width="54" bgcolor="#FFFFFF"><font color="#999999"><%if action="yes" then
response.Write("已处理")
end if
if action="no" then
response.Write("未处理")
end if
if action="all" then
if rs("deal")=0 then
response.Write("未处理")
else
response.Write("已处理")
end if
end if
%></font></td>
<td width="53" bgcolor="#FFFFFF"><input type="checkbox" name="orderid" value="<%=rs("orderid")%>"></td>
</tr>
<%
i=i+1
'if i>=maxperpage then exit do
rs.movenext
loop
'rs.close
'set rs=nothing
%>
<tr>
<td height="27" colspan="11" bgcolor="#FFFFFF"><div align="right"><%if action="no" then%><input type="submit" name="deal" value="已处理" onclick="this.form.action='saveorders.asp?action=deal'"><%end if%> <input type="submit" name="del" value="删 除" onclick="this.form.action='saveorders.asp?action=del'"> 全选 <input type="checkbox" name="all" value=" all" onclick="mm()" > </div></td>
</tr>
</table>
<%
End sub
function showPage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage =0 then
n=totalnumber\ maxperpage
else
n=totalnumber \ maxperpage + 1
end if
if n< 1 then
n=1
end if
%>
<form name="form2" method="post" action="<%=filename%>?action=<%=action%>"><div align="center" class="STYLE1">
共有<%=totalnumber%>条记录 页次:<%=currentpage%>/<%=n%>
<%
if currentpage<2 then
%>首页 上一页
<%else%>
<a href="<%=filename%>?page=1&action=<%=action%>">首页</a> <a href="<%=filename%>?page=<%=currentpage-1%>&action=<%=action%>">上一页</a>
<%end if%>
<%
if n-currentpage <1 then
%>下一页 尾页
<%else%>
<a href="<%=filename%>?page=<%=currentpage+1%>&action=<%=action%>">下一页</a> <a href="<%=filename%>?page=<%=n%>&action=<%=action%>">尾页</a>
<%end if%>
转到 <select name="cndok" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i=1 to n
if n=currentpage then
%>
<option value="<%=filename%>?page=<%=i%>" selected="selected">第<%=i%>页</option>
<%else%>
<option value="<%=filename%>?page=<%=i%>">第<%=i%>页</option>
<%
end if
next
%>
</select></div></form>
<%
end function
%>
</td></form>
</tr>
<tr>
<td height="97" colspan="3" align="center"> </td>
</tr>
</table>
</body>
</html>
<script language="javascript">
<!--
function mm()
{
var a=document.getElementsByTagName("input");
if(a[0].checked==true){
for(var i=0;i< a.length;i++)
if (a[i].type=="checkbox")
a[i].checked=false;
}
else
{
for (var i=0;i< a.length;i++)
if(a[i].type=="checkbox")
a[i].checked=true;
}
}
-->
</script>