I have tried many, many things, but keep getting error 3001 (Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another) when trying to add parameters to a command object.
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = con
cmd.CommandText = "ProcName"
cmd.CommandType = 4 'adCmdStoredProc
MsgBox("0")
'cmd.Parameters.Append(cmd.CreateParameter("@InvoiceNumber", adVarChar, adParamInput, 100, sInvoice))
Set pInvoiceNumber = cmd.CreateParameter("@InvoiceNumber", adVarChar, adParamInput, 100, sInvoice)
cmd.Parameters.Append(pInvoiceNumber)
The connection object is valid and open at the time that this code runs. The @InvoiceNumber parameter of the stored procedure is a varchar(100). What am I missing here?
Set pInvoiceNumber = ...line.Set cmd.ActiveConnection = con?Set.Refresh(): support.microsoft.com/kb/185125 ?