• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

一个很强大的分页代码。

mysql 搞代码 4年前 (2022-01-09) 35次浏览 已收录 0个评论

主要代码 set rowcount 30 select * from (select top 30 * from (select top 30 * from table order by id asc) z order by z.id desc) zz order by id asc 可以在任何程序里扩展 大家试试看。需要源码的找我。 程序是在asp 里测试的。已测试通过。 速度翻页

主要代码
set rowcount 30
select * from (select top 30 * from (select top 30 * from table order by id asc) z order by z.id desc) zz order by id asc

可以在任何程序里扩展
大家试试看。需要源码的找我。
程序是在asp 里测试的。已测试通过。
速度翻页速度很快。
AD:http://www.uutvs.com
<style> .CodeEntity .code_pieces ul.piece_anchor{width:25px;position:absolute;top:25px;left:-30px;z-index:1000;} .CodeEntity .code_pieces ul.piece_anchor li{width:25px;background: #efe;margin-bottom:2px;} .CodeEntity .code_pieces ul.piece_anchor li{border-left:3px #40AA63 solid;border-right:3px #efe solid;} .CodeEntity .code_pieces ul.piece_anchor li:hover{border-right:3px #40AA63 solid;border-left:3px #efe solid;} .CodeEntity .code_pieces ul.piece_anchor li a{color: #333;padding: 3px 10px;} .CodeEntity .code_pieces .jump_to_code{visibility:hidden;position:relative;} .CodeEntity .code_pieces .code_piece:hover .jump_to_code{visibility:visible;} .CodeEntity .code_pieces .code_piece:hover .jump_to_code a{text-decoration:none;} .CodeEntity .code_pieces h2 i{float:right;font-style:normal;font-weight:normal;} .CodeEntity .code_pieces h2 i a{font-size:9pt;background: #FFFFFF;color:#00A;padding: 2px 5px;text-decoration:none;} </style> <!—ecms

    –> 本文来源gao@!dai!ma.com搞$$代^@码5网@ <!—ecms

  • $velocityCount
  • –> <!—ecms

–>

' * 数据库转json  分页公用类库' * EMAIL:[email protected] QQ:82366788 $' * $Author: Cason $' * $Id: yl_clsjson.asp 6481 2011-11-26 00:21:46 Cason $	property get order_name()		dim o_sql,o_colum,olen,o_pai,i		dim left_sql,right_sql		o_sql = Cason_sql		olen = instr(o_sql,"order")		left_sql = left(o_sql,olen-1)		right_sql = trim(mid(o_sql,olen))		if olen = 0 then			response.write "请设定排序方式!"			response.end		end if 		o_sql = split(right_sql," ")		for i = 0 to ubound(o_sql)			if o_sql(i) = "by" then 				if i>1 then					o_sql(1) = "by"					o_sql(i) = ""				end if 			end if 			if i>2 and o_sql(2) = "" and o_sql(i)  "" then				o_sql(2) = o_sql(i)				o_sql(i) = ""			end if 			if o_sql(i) = "asc" or o_sql(i) = "desc" then				if i >3  then					o_sql(3) = o_sql(i)					o_pai = " " & o_sql(i)					o_sql(i) = ""					exit for 				end if 			end if 		next		right_sql = join(o_sql)		if o_pai = "" then			o_pai = " asc"			right_sql = replace(right_sql,o_sql(2),o_sql(2) & " asc")		end if 		cason_sql = left_sql & right_sql				order_name = o_sql(2) & o_pai			end property		property get th(ByVal str_val)		if instr(str_val,"desc") >0 then			th = replace(str_val,"desc","asc")		else			th = replace(str_val,"asc","desc")		end if 	end property 	'================================================================	' ResultSet 返回分页后的记录集	'================================================================	public Property Get ResultSet()		dim Cason_Rs,col_name		dim top_sql,top_Count,select_sql		dim set_sql 		col_name = order_name		if int(Cason_CurrPage) = 1 then			top_sql = " top " & Cason_PageSize & " "			top_Count = 0		else			top_sql = " top " & (Cason_CurrPage) * Cason_PageSize & " "			top_Count = (Cason_CurrPage - 1) * Cason_PageSize 		end if 		set_sql = "select" & top_sql & trim(mid(Cason_sql,7))		select_sql = "set rowcount " & Cason_PageSize & ";select * from (select top " & Cason_PageSize & " * from (" & set_sql & ") z order by " & th(col_name) & " ) zz order by zz." & col_name 		set Cason_Rs = yl.GetRs(select_sql,1,1)		if int(Cason_CurrPage)>Cason_Rs.pagecount then			Cason_CurrPage = Cason_Rs.pagecount		end if		Cason_Rs.PageSize	= Cason_PageSize		Cason_JsonHtml = ",""iRecCount"":""" & num_rows & """"		response.write toJSON("""info""",Cason_Rs)	End Property

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:一个很强大的分页代码。
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址