Any help on this would be much appreciated:
I have a stored procedure, say, on Northwind demo db like:
CREATE PROCEDURE up_CustCount @parm1 varchar(256) AS
Begin
select count(*) from customers
end
GO
and the following
VB code:
Dim oCon As ADODB.Connection
Dim oCmd As ADODB.Command
Dim oParm As ADODB.Parameter
Dim oRS As ADODB.Recordset
Set oCon = New ADODB.Connection
oCon.Provider = "SQLOLEDB"
oCon.Properties("Integrated Security").Value = "SSPI"
oCon.Open "Server=(local);Database=Northwind"
Set oCmd = New ADODB.Command
Set oCmd.ActiveConnection = oCon
oCmd.CommandText = "up_CustCount"
Set oParm = oCmd.CreateParameter("@parm1", adVarChar, adParamInput, 256, "asas")
oCmd.Parameters.Append oParm
Set oRS = oCmd.Execute
MsgBox oRS.Fields(1)
oRS.Close
oCon.Close
I just get an error "Procedure 'up_CustCount' expects parameter '@parm1', which was not supplied."
But I have supplied it!
Can anyone help please?