查询结果分页出错,求帮助
程序代码:
<%date1=CDate(request("date1")) date2=CDate(request("date2")) set rs = Server.createobject("adodb.recordset") sql = "SELECT * FROM [rkb] WHERE rksj between#"&date1&"# and #"&date2&"# " rs.open sql,conn,1,1 If rs.Eof Then Else rs.PageSize=15 page= request("page") If Not Isnumeric(page) or page="" Then page=1 else page=cint(page) End if If page<1 Then page=1 If page>rs.pagecount Then page=rs.pagecount rs.AbsolutePage = page For i=1 To rs.pagesize id = rs("id") name = rs("name") xh = rs("xh") dw = rs("dw") sl = rs("sl") dj = rs("dj") yt = rs("yt") gmr = rs("gmr") bgr = rs("bgr") lysj = rs("rksj")%> <tr> <td><%=rs("id")%></td> <td><%=rs("name")%></td> <td><%=rs("xh")%></td> <td><%=rs("dw")%></td> <td><%=rs("sl")%></td> <td><%=rs("dj")%></td> <td><%=rs("yt")%></td> <td><%=rs("gmr")%></td> <td><%=rs("bgr")%></td> <td><%=rs("rksj")%></td> <td><a href="rkedit.asp?id=<%=rs("id")%>">修改</a></td> <td><a href="javascript:if (confirm('确定要删除该记录?')) {location.href='rkdelet.asp?id=<%=rs("id")%>'}"> 删除</a></td> </tr> <%rs.movenext If rs.Eof then Exit For End if Next End If Call fpage("date1|date2",rs.recordcount,page,rs.pagecount,rs.pagesize) '这里面分页函数 rs.close set rs = nothing %> <%Function fpage(str,recordcount,page,pagecount,pagesize) s=Split(str,"|") s2="" For i=0 To UBound(s) s2=s2&"&"&s(i)&"="&request(s(i)) next response.write "<table width=""100%"" cellpadding=0 cellspacing=0 border=0>" response.write " <tr>" response.write " <td align=""center"" width=""95%""> 记录总数:"&recordcount&"条 页次:"&page&"/"&pagecount&"页 " & pagesize & "个/页" If page<=1 Then response.write " 首 页 上一页 " Else response.write " <a href=""?page=1"&s2&"""><font color='#ff0000'>首 页</font></a> <a href=""?page="&(page-1)&s2&"""><font color='#ff0000'>上一页</font></a> " End If If page>=pagecount Then response.write "下一页 尾 页 " Else response.write "<a href=""?page="&(page+1)&s2&"""><font color='#ff0000'>下一页</font></a> <a href=""?page="&pagecount&s2&"""><font color='#ff0000'>尾 页</font></a> " End If response.write " <select name=""page"" onchange=""spage(this.value)"">" For i=1 To pagecount response.write "<option value="&i If CInt(page)=CInt(i) Then response.write " selected" response.write ">第"&i&"页</option>"&vbnewline next response.write "</select>"&vbnewline response.write "</td> "&vbnewline response.write " <td width=""5%""></td>"&vbnewline response.write " </tr>"&vbnewline response.write "</table>"&vbnewline response.write "<script language=""javascript"">"&vbnewline response.write "function spage(id)"&vbnewline response.write "{"&vbnewline response.write "location.href=""?page=""+id+"""&s2&""";"&vbnewline response.write "}"&vbnewline response.write "</script>"&vbnewline End function %>提示
rs.PageSize=15 page= request("page")
语句未结束,请指教,谢谢!