分页存储过程
@ipagecount int output --定义输出变量,放在@querystr上面
....
exec('select'+@fdshow+'from'+@querystr+@fdorder) --统计记录数,放在--如果显示第一页...上面
select @ipagecount = @@rowcount
调用方法(asp):
myconstr = "driver={sql server};server=(local);uid=artme;pwd=***;database=artme"
dim mycomm,userid,username
set mycomm = server.createobject("adodb.command")
with mycomm
.activeconnection = myconstr 'myconstr是数据库连接字串
.commandtext = "p_show" '指定存储过程名
.commandtype = 4 '表明这是一个存储过程
.prepared = true '要求将sql命令先行编译
.parameters.append .createparameter("return",2,4)
.parameters.append .createparameter("@ipagecount",3,2)
.parameters.append .createparameter("@querystr",200,1,4000,"select * from zw_language")
.parameters.append .createparameter("@pagesize",3,1,4,5)
.parameters.append .createparameter("@pagecurrent",3,1,4,1)
.parameters.append .createparameter("@fdshow",200,1,4000)
.parameters.append .createparameter("@fdorder",200,1,1000)
.execute
end with
icount = mycomm(1)
response.write icount
trackback: http://tb.blog.csdn.net/trackback.aspx?postid=566682
申明:本教程内容由威凡网编辑整理并提供IT程序员分享学习,如文中有侵权行为,请与站长联系(QQ:254677821)!
|