请问存储过程的问题,谢谢!

szwendy 2003-10-17 03:28:44
我想从存储过程中输出一个参数,是这样写的:
CREATE PROCEDURE dbo.PRO_pageview
(

@tint_tableid int=1,
@int_pagenow int=0,
@int_pagesize int=0,
@int_recordcount int=0 output
)
as
select @int_allid=count(*) from bbs_10 where layer=1
select @int_recordcount=@int_allid

select top 100 * from bbs_10
go

然后用asp取出int_recordcount的值:
set cmd=server.CreateObject("adodb.command")
cmd.ActiveConnection=conn
cmd.CommandType=4
cmd.CommandText="pro_pageview"

cmd.Parameters.Append cmd.CreateParameter("int_recordcount",adInteger,adParamOutput)

set rs=cmd.Execute

recordcount=cmd.Parameters("int_recordcount")
Response.Write recordcount

可输出来的值是空,请问错在哪?该怎么写,谢谢!

...全文
74 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
nchen123 2004-03-05
  • 打赏
  • 举报
回复
:)
szwendy 2003-10-17
  • 打赏
  • 举报
回复
高手呢,怎么没人回答呢?
szwendy 2003-10-17
  • 打赏
  • 举报
回复
用查询分析器可以输出值,但到asp中就不行了
nchen123 2003-10-17
  • 打赏
  • 举报
回复
@tint_tableid int=1,
@int_pagenow int=0,
@int_pagesize int=0,

这些参数应该添加吧?
nchen123 2003-10-17
  • 打赏
  • 举报
回复
先用查询分析器测试你的存储过程是否能输出值,

execute PRO_pageview, ....
print @int_recordcount
szwendy 2003-10-17
  • 打赏
  • 举报
回复
这样也是一样的,得出的值为空
nchen123 2003-10-17
  • 打赏
  • 举报
回复
recordcount=cmd.Parameters("int_recordcount").value

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧