asp新闻过长分页问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 18:37:14
<%
cindex=request("cindex")
set rsint=conn.execute("select * from [tb_fhintro] where cflag=0 and cindex=1")
%>
<%dim a,page,x,total_page,b,c,d
a=rsint("cinfo")
x=len(a)
total_page=int(x/1000)
%>
<%
if x<1000 then
response.Write a
else%>

<%
if page<total_page then
page=total_page
end if
request("page")
page=3
x=1000*page
if sgn(x)<0 then
page=0
x=0

end if
if x=0 then
b=left(a,1000)
else
b=mid(a,x,1000)
end if
response.write b
%>
<%end if%>
老是没分开!~不知道哪出错

<%if Not rs.EOF then
dim newsperpage
newsperpage=10
rs.movefirst
rs.pagesize=newsperpage
if trim(request("page"))<>"" then
page1=trim(request("page"))
if check_num(page1)=true then
curjingtpage=clng(request("page"))
if curjingtpage>rs.pagecount then
curjingtpage=rs.pagecount
End if
else
curjingtpage=1
end if
else
curjingtpage=1
End if
totalnews=rs.recordcount
if curjingtpage<>1 then
if (curjingtpage-1)*newsperpage<totalnews then
rs.move(curjingtpage-1)*newsperpage
dim bookmark
bookmark=rs.bookmark
End if
End if
if (totalnews mod newsperpage)=0 then
totalpages=totalnews\newsperpage
else
totalpages=totalnews\newsperpage+1
End if
i=0
Do While Not rs.E