提示出错“ 过程 'UserLogin' 需要参数 '@iReturn',但未提供该参数。 ”
我把存储过程稍作修改,再调用,提示出错“ 过程 'UserLogin' 需要参数 '@iReturn',但未提供该参数。 ”
CREATE PROCEDURE UserLogin
@Tablename nvarchar(50),
@Username nvarchar(50),
@UserPassword nvarchar(50),
@iReturn int output
as
select * from [@Tablename] where username=@Username
if(@@rowcount <1)
begin
set @iReturn=0
end
else
begin
select * from [@Tablename] where username=@username and [password]=@UserPassword
if(@@rowcount <1)
begin
set @iReturn=1
end
else
begin
set @iReturn=2
end
end
GO
'====================================调用如下====================================================
<% dim action,username,password,Tablename,MyComm
action=Trim(Request.QueryString("action"))
if action="login" then
username=Trim(Request.Form("username"))
password=Trim(Request.Form("password"))
Tablename="Userlist"
Set MyComm = Server.CreateObject(")
with MyComm
.ActiveConnection = conn
.CommandText = "UserLogin"
.CommandType = 4
.Prepared = true
.Parameters.Append .CreateParameter("@Tablename",200,1,50,Tablename)
.Parameters.Append .CreateParameter("@Username",200,1,50,username)
.Parameters.Append .CreateParameter("@UserPassword ",200,1,50,password)
.Parameters.append .CreateParameter("@iReturn",3,1,4)
.Execute
end with
loginvalue= MyComm(3)
'-------------------------------------------------
'---功能描述:验证用户登陆
'---0,用户不存在
'---1,密码错误
'---2,成功
'------------------------------------------------
select case loginvalue
case 0
response.write" 用户不存在"
case 1
response.write" 密码错误"
case 2
response.write" 登陆成功"
end select
end if
%>