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

hebhd hebhd 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我要根据 @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 '有值




...全文
评论 2
收藏 已收藏
分享
返回顶部
hebhd
ASP 28,401 成员 356,940 内容