create procedure sp_test
@count int output
as
begin
select @count=count(*) from sysobjects
select * from sysobjects
return 1
end
godeclare @code int,@count int
exec @code=sp_test @count outputselect @code,@count
godrop procedure sp_test
go
@count int output
as
begin
select @count=count(*) from sysobjects
select * from sysobjects
return 1
end
godeclare @code int,@count int
exec @code=sp_test @count outputselect @code,@count
godrop procedure sp_test
go
objCmd.ActiveConnection=Application("SqlSverdbs")
objCmd.CommandType=4
objCmd.CommandText="sp_test"
objCmd.Parameters.Refresh
set objRs=objCmd.execute
iRETURN_VALUE=objCmd.Parameters("@RETURN_VALUE").Value记录可以得到,但是iRETURN_VALUE返回值总是得不到。
set objCmd=server.CreateObject("adodb.command")
objCmd.ActiveConnection=Application("SqlSverdbs")
objCmd.CommandType=4
objCmd.CommandText="sp_test"
objCmd.Parameters.Refresh
objCmd.Execute() --新增返回值
iRETURN_VALUE=objCmd.Parameters("@RETURN_VALUE").Value
set objRs=objCmd.execute --返回集