<%
rs.pagesize=msg_per_page '定义分页记录集每页显示记录数

if not (rs.eof and rs.bof) then
	totalrec=RS.RecordCount                     '总记录条数
	if rs.recordcount mod msg_per_page=0 then 
		n=rs.recordcount\msg_per_page'n:总页数
	else
		n=rs.recordcount\msg_per_page+1                        
	end if                                                                
	currentpage2=page                        'currentpage:当前页
	If currentpage2 <> "" then
		currentpage2 =  cint(currentpage2)
		if currentpage2 < 1 then  
			currentpage2 = 1
		end if  
		if err.number <> 0 then                     
			err.clear
			currentpage2=1
		end if
	else
		currentpage2=1
	End if                                                                
	if currentpage2*msg_per_page > totalrec and not((currentpage2-1)*msg_per_page < totalrec)then 
		currentPage=1
	end if
	rs.absolutepage=currentpage2                    
	rowcount=rs.pagesize 
end if
%>