错误类型: ADODB.Recordset (0x800A0CB3) /ASP/index.asp, 第 27 行 ( 即 rs.AbsolutePage = CInt(currentPage) )
是什么错误???
那位高手给我们讲讲分页显示的使用吧
我参考的书上讲的太少了
谢谢了!!!
<!--#include virtual = "/adovbs.inc" --> dim currentPage,rowCount,i currentPage =request.Querystring("currentPage") if crrentPage = "" then currentPage = 1 end if
dim cnn set cnn= server.createObject("ADODB.Connection") cnn.open "provider=Microsoft.JET.OLEDB.4.0; DATA SOURCE= " & Server.mapPath("Data/bingxue.mdb")
dim rs set rs = server.createObject("ADODB.recordset")
dim sql sql="select * from topices"
rs.CursorType = adOpenStatic rs.PageSize = 15 rs.open sql ,cnn
<% dim url
url="xx.asp"
<% const MaxPerPage=8 '一页有多少条 dim totalPut '总记录 dim CurrentPage '当前页 dim TotalPages '总页数 dim i rs.movefirst rs.pagesize=MaxPerPage %> <% totalPut=rs.recordcount '总页数 if (totalput mod maxPerPage)<>0 then TotalPages=(totalput\maxPerPage)+1 else TotalPages=(totalput\maxPerPage) end if '当前页 page=request("page") page=replace(page,"'","") page=replace(page,"''","") if page="" then page=1 CurrentPage=1 end if if trim(page)>trim(TotalPages) or page<0 then response.write("出错了") response.end end if if page<>"" then CurrentPage=page 'page 没有传递过来时,默认第一页 end if '显示“前一页”“后一页”和数字页码 if Currentpage >1 then back=currentpage-1 response.write ("<a href="&url&"?page="&back&">前一页</a>") else response.write "前一页" end if response.write " " for j=1 to totalPages if trim(j)=trim(page) then response.write(j) else response.write ("<a href="&url&"?page="&j&">"&j&"</a>") end if response.write (" ") next if trim(Currentpage) < trim(totalPages) then enext=currentpage+1 response.write ("<a href="&url&"?page="&enext&">后一页</a>") else response.write ("后一页") end if response.write("<br>") %>