asp调用存储过程,问题出在那 10
SQL创建存储过程dropprocedureCheckTb_UserLimitgoCREATEPROCEDURECheckTb_UserLimit(@returnValu...
SQL创建存储过程
drop procedure CheckTb_UserLimit
go
CREATE PROCEDURE CheckTb_UserLimit
(
@returnValue int output,
@ac_o_retMsg varchar(255),
@ac_i_UserID int,
@ac_i_LimitKey varchar(30)
)
as
(
select @returnValue=LimitID from tb_UserLimit where UserID=@ac_i_UserID
and LimitID=( select LimitID from tb_Limit where LimitKEY=@ac_i_LimitKey)
)
select @ac_o_retMsg='你没有权限'
asp调用存储过程
Sub GetLimitCheckData(tmpKey)
dim RecNum
set cmd=server.CreateObject("adodb.command")
with Cmd
.ActiveConnection=Conn
.CommandText = "CheckTb_UserLimit"
.CommandType = 4
.Parameters.Append .CreateParameter("returnValue",2,4)
.Parameters.Append .CreateParameter("ac_o_retMsg",200,4,255)
.Parameters.Append .CreateParameter("ac_i_UserID",3,1,4,userid) 'User Id
.Parameters.Append .CreateParameter("ac_i_LimitKey",200,1,30,tmpKey) 'Limit Key
.Prepared= true
end with
set rs=cmd.Execute()
ErrorMsg=cmd("ac_o_retMsg")
ReturnValue=cmd("returnValue")
set cmd=nothing
if returnValue<0 then
response.write "<script>alert('提示:" & ErrorMsg & "');history.back()</script>"
else
if ReturnValue>0 then
Session("HADLIMIT")="YES"
else
Session("HADLIMIT")="NO"
end if
end if
'rs.close
'set rs=nothing
set Cmd=nothing
end Sub
请各们高指点,可以这样用吗
问题出在那
提示:
Microsoft OLE DB Provider for SQL Server 错误 '80040e07'
将数据类型 varchar 转换为 int 时出错。
/qx/GetLimitData.asp,行 21
21行是: set rs=cmd.Execute() 展开
drop procedure CheckTb_UserLimit
go
CREATE PROCEDURE CheckTb_UserLimit
(
@returnValue int output,
@ac_o_retMsg varchar(255),
@ac_i_UserID int,
@ac_i_LimitKey varchar(30)
)
as
(
select @returnValue=LimitID from tb_UserLimit where UserID=@ac_i_UserID
and LimitID=( select LimitID from tb_Limit where LimitKEY=@ac_i_LimitKey)
)
select @ac_o_retMsg='你没有权限'
asp调用存储过程
Sub GetLimitCheckData(tmpKey)
dim RecNum
set cmd=server.CreateObject("adodb.command")
with Cmd
.ActiveConnection=Conn
.CommandText = "CheckTb_UserLimit"
.CommandType = 4
.Parameters.Append .CreateParameter("returnValue",2,4)
.Parameters.Append .CreateParameter("ac_o_retMsg",200,4,255)
.Parameters.Append .CreateParameter("ac_i_UserID",3,1,4,userid) 'User Id
.Parameters.Append .CreateParameter("ac_i_LimitKey",200,1,30,tmpKey) 'Limit Key
.Prepared= true
end with
set rs=cmd.Execute()
ErrorMsg=cmd("ac_o_retMsg")
ReturnValue=cmd("returnValue")
set cmd=nothing
if returnValue<0 then
response.write "<script>alert('提示:" & ErrorMsg & "');history.back()</script>"
else
if ReturnValue>0 then
Session("HADLIMIT")="YES"
else
Session("HADLIMIT")="NO"
end if
end if
'rs.close
'set rs=nothing
set Cmd=nothing
end Sub
请各们高指点,可以这样用吗
问题出在那
提示:
Microsoft OLE DB Provider for SQL Server 错误 '80040e07'
将数据类型 varchar 转换为 int 时出错。
/qx/GetLimitData.asp,行 21
21行是: set rs=cmd.Execute() 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询