急急急........
<%@ language=vbscript %>
<!-- #include file="conn.asp" -->
<%
dim cha,d1,d2
cha=trim(request.form("cha"))
d1=trim(request("r1"))
d2=trim(request("r2"))
if cha="" then
cha = request("cha")
end if
if d1="" then
cha = request("d1")
end if
if d2="" then
cha = request("d2")
end if
set rs=server.createobject("adodb.recordset")
if cha<>"" then
sql="select * from chanpin where id like '%" & cha & "%'"
else
if d1="" and d2="" then
response.write "请输入关键字!"
else
sql="select * from chanpin where dt>=cdate('"&d1&"') and dt<=cdate('"&d2&"')"
end if
end if
rs.open sql,conn,1,1
if rs.recordcount<1 then
%>
对不起无资料
<%
else
rs.pagesize =2
page = request("page")
%>
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100">
<div align="center">定单号</div></td>
<td width="100">
<div align="center">提交时间</div></td>
<td width="100"><div align="center">状态</div></td>
<td width="100">
<div align="center">定单总额</div></td>
<td width="100">
<div align="center">结算价总额</div></td>
<td width="100">
<div align="center">打印</div></td>
<td width="100">
<div align="center">执行情况</div></td>
</tr>
<%
if page <> "" and isnumeric(page) then
page = cint(page)
if page <= 1 then page = 1
if page > rs.pagecount then page = rs.pagecount
else
page = 1
end if
rs.absolutepage = page
pagecounts=rs.pagecount
for i=1 to rs.pagesize
%>
<tr>
<td><div align="center"><%=rs("id")%></div></td>
<td><div align="center"><%=rs("dt")%></div></td>
<td width="100">
<div align="center"></div></td>
<td><div align="center"><%=rs("zongjia")%></div></td>
<td><div align="center"><%=rs("shijia")%></div></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
end if
%>
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr><td><div align="right">共有<%=rs.recordcount%>条记录</div></td></tr>
<tr>
<td><div align="right">
<form method="post" action="ddc.asp" name="form1">
<%first_page="第一页"
previous_page="上一页"
next_page="下一页"
end_page="尾页"
if Page = 1 then
response.write first_page&" "&previous_page&" "
end if
if Page > 1 then
response.write "<a
href='javascript:form1.page.value=1;form1.submit();'>"&first_page&"</a> <a href='javascript:form1.page.value=" &
(page-1) & ";form1.submit();'>"&previous_page&"</a> "
end if
if page < pagecounts then
response.write "<a href='javascript:form1.page.value=" & (page+1) &
";form1.submit();'>"&next_page&"</a> <a href='javascript:form1.page.value=" & pagecounts&
";form1.submit();'>"&end_page&"</a>"
end if
if page >= pagecounts then
response.write next_page&" "&end_page
end if%>
<input type="hidden" name="page" value="<%=page%>">
<input type="hidden" name="cha" value="<%=cha%>">
<input type="hidden" name="d1" value="<%=d1%>">
<input type="hidden" name="d2" value="<%=d2%>">
</form>
</div></td>
</tr>
</table>
</table>
为什么每到翻页的时候就没有记录了 另外 第一次查询的时候还说有多条记录 还应有下一页