I have the following stored procedure in SQL server and can call it just fine from within SQL Server:
CREATE PROCEDURE uspRecipeNote
@IngString varchar(255) OUTPUT,
@MixID int = NULL
AS
SET NOCOUNT ON;
SET @IngString = dbo.ufnRecipeNote(@MixID);
I have been using VBA in Access to call stored procedures for months and have never had a problem, but have tried several possibilities and am stumped, getting either of the following errors, depending upon what I have tried:
"Parameter object is improperly defined. Inconsistent or incomplete information was provided." "Procedure or function uspRecipeNote has too many arguments specified."
Here is what I have at this point in VBA:
Set cmd.ActiveConnection = cn
cmd.CommandTimeout = 0
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "uspRecipeNote"
'add parameters
cmd.Parameters.Append cmd.CreateParameter("@IngString", adVarChar, adParamOutput)
cmd.Parameters.Append cmd.CreateParameter("@MixID", adInteger, adParamInput, , intMixID)
cmd.Execute
I get an error on the first parameter no matter what I have tried. I suspect it is something simple. Thanks in advance for any help!
ExecuteinsteadADODB.Commandsand put into record setDim rs as New ADODB.Recordsetand thenrs = connection_name.Execute ("EXEC uspRecipeNote @IngString OUTPUT, " & intMixID & ";").