I use SQL 2000 and has a simple stored procedure
CREATE PROCEDURE [CheckEmplLogin]
@username varchar(50), @password varchar(50)
AS
select empl_id, passwd, privilege from employee where empl_id = @username and passwd = @password
return @@error
GO
and in ASP, if I type in
<%
set cmd = Server.CreateObject("ADODB.Command"
cmd.ActiveConnection = DB_Connect
cmd.CommandText = "CheckEmplLogin"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Refresh
%>
<Table Border=1>
<TR>
<TD><B>PARAMETER NAME</B></TD>
<TD><B>DATA-TYPE</B></TD>
<TD><B>DIRECTION</B></TD>
<TD><B>DATA-SIZE</B></TD>
</TR>
<% For Each param In cmd.Parameters %>
<TR>
<TD><%= param.name %></TD>
<TD><%= param.type %></TD>
<TD><%= param.direction %></TD>
<TD><%= param.size %></TD>
</TR>
<%
Next
%>
If I do this, everything works fine and I got a nice table with all the information I need for this stored procedure. But the problem is when I really try to do the code:
cmd.Parameters.Append cmd.CreateParameter("username",adVarChar,adParamInput)
cmd.Parameters.Append cmd.CreateParameter("password",adVarChar,adParamInput)
then I got a error:
Error Type:
ADODB.Parameters (0x800A0E7C)
Parameter object is improperly defined. Inconsistent or incomplete information was provided.
Can somebody please help me out??? Thank you very much!!
CREATE PROCEDURE [CheckEmplLogin]
@username varchar(50), @password varchar(50)
AS
select empl_id, passwd, privilege from employee where empl_id = @username and passwd = @password
return @@error
GO
and in ASP, if I type in
<%
set cmd = Server.CreateObject("ADODB.Command"
cmd.ActiveConnection = DB_Connect
cmd.CommandText = "CheckEmplLogin"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Refresh
%>
<Table Border=1>
<TR>
<TD><B>PARAMETER NAME</B></TD>
<TD><B>DATA-TYPE</B></TD>
<TD><B>DIRECTION</B></TD>
<TD><B>DATA-SIZE</B></TD>
</TR>
<% For Each param In cmd.Parameters %>
<TR>
<TD><%= param.name %></TD>
<TD><%= param.type %></TD>
<TD><%= param.direction %></TD>
<TD><%= param.size %></TD>
</TR>
<%
Next
%>
If I do this, everything works fine and I got a nice table with all the information I need for this stored procedure. But the problem is when I really try to do the code:
cmd.Parameters.Append cmd.CreateParameter("username",adVarChar,adParamInput)
cmd.Parameters.Append cmd.CreateParameter("password",adVarChar,adParamInput)
then I got a error:
Error Type:
ADODB.Parameters (0x800A0E7C)
Parameter object is improperly defined. Inconsistent or incomplete information was provided.
Can somebody please help me out??? Thank you very much!!