I am using ADO to execute some stored procedure with success but I do have problems to pass a value to the following procedure.
I would like to pass the value “X” and execute the procedure using a command such as:
…….
With cmd
.CommandType = adCmdStoredProc
.CommandText = “SPbrand"
End With
…….
The above command works fine if there is no parameter but do not work with one.
How could I use a similar command and pass one or more variables to the stored procedure?
Any help would be greatly appreciated.
Thanks in advance.
Louis
For information this is the procedure:
CREATE PROCEDURE SPbrand
@ValLet varchar(50)
AS
SELECT TRADE_1.Trade FROM TRADE_1 GROUP BY TRADE_1.Trade HAVING (((TRADE_1.Trade) Like ‘@ValLet%’ )) ORDER BY TRADE_1.TradeName;