New2VB
04-18-2004, 05:20 AM
I have a stored proc in MS SQL Server 2000:
CREATE PROCEDURE spBCountSub
@Cnt int output ,
@SubC char(2)
as
SELECT @Cnt=COUNT(tblB4.Code)
FROM tblB4 INNER JOIN
tblB1 ON tblB4.Code = tblB1.Code
WHERE tblB1.SubC = @SubC
GO
but when i want to execute this by a command object, i get the following error: -2147217900
formal parameter '@SubC' was defined as OUTPUT but the actual parameter not declared OUTPUT
but i defined tha param as:
Set pSubC = cmd.CreateParameter("SubC", adChar, adParamInput, 2) cmd.Parameters.Append pSubC
plz help.
CREATE PROCEDURE spBCountSub
@Cnt int output ,
@SubC char(2)
as
SELECT @Cnt=COUNT(tblB4.Code)
FROM tblB4 INNER JOIN
tblB1 ON tblB4.Code = tblB1.Code
WHERE tblB1.SubC = @SubC
GO
but when i want to execute this by a command object, i get the following error: -2147217900
formal parameter '@SubC' was defined as OUTPUT but the actual parameter not declared OUTPUT
but i defined tha param as:
Set pSubC = cmd.CreateParameter("SubC", adChar, adParamInput, 2) cmd.Parameters.Append pSubC
plz help.