带返回参数及记录集的存储过程,高手进

hebhd 2010-09-13 03:14:41
我要根据 @b 的值来决定对 记录集aa 的存取.


Create proc test
@i nvarchar(1)
,@b nvarchar(2) output
as
Set @b='11'
select aa=Getdate()




Set MyComm = Server.CreateObject("ADODB.Command")
With MyComm

.ActiveConnection =Conn 'MyConStr是数据库连接字串
.CommandText = "test" '指定存储过程名
.CommandType = 4 '表明这是一个存储过程
.Prepared = true '要求将SQL命令先行编译
.Parameters.append .CreateParameter("@i",20,1,1,"1")
.Parameters.append .CreateParameter("@b",200,2,200,ErrMsg)
Set RsTemp=.Execute

End With
'第一种情况
response.write ErrMsg '这里为空
response.wirte RsTemp(0) '有值
'第二种情况
rstemp.close
response.write ErrMsg '有值




...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hebhd 2010-09-13
  • 打赏
  • 举报
回复
郁闷...为啥一次发两个贴子...
我的分...
  • 打赏
  • 举报
回复
'第三种情况,想都有值的话,那就:
response.wirte RsTemp(0) '有值
rstemp.close
response.write ErrMsg '有值

28,391

社区成员

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

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