Re: Too many arguments in Stored Proc (VB6)
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Fri, 24 Nov 2006 08:28:34 -0500
EdwardH wrote:
I am getting error message - "Procedure or Function zSpace has too
many arguments specified". Any comments gratefully received..
I have stored proc:
CREATE PROCEDURE dbo.zSpace @Wareh nvarchar(1)
AS
Nothing to do with your problem, but it is a good idea to start your
procedure by turning on nocount:
SET NOCOUNT ON
This will prevent informational "x rows effected" messages from interfering
with your ability to retrieve the result of your RETURN statement.
DECLARE @lWspace int
SELECT @lWspace=SUM(DISTINCT Height*Width*Depth)
from PartInvent
where ( Left(plocation,1) =@Wareh)
RETURN @lWspace
GO
and I am using VB6 Function to get total warehouse area:
Public Function GetTotal(ByVal sStoredProcName As String, sWare As
String) As Long
Dim oCmd As New ADODB.Command
Dim oParam As ADODB.Parameter
Set oCmd.ActiveConnection = invConn
oCmd.CommandText = sStoredProcName
oCmd.CommandType = adCmdStoredProc
oCmd.Parameters.Append oCmd.CreateParameter("Wareh", adChar,
adParamInput, 1, sWare)
oCmd.Parameters.Append oCmd.CreateParameter("RETURN_VALUE", adInteger,
adParamReturnValue)
oCmd.Execute
GetTotal = oCmd.Parameters("RETURN_VALUE")
Typically, the RETURN parameter needs to be appended first, before any of
the input or output parameters. Give that a try.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- Prev by Date: Parameter ?_1 has no default value.
- Next by Date: Re: Parameter ?_1 has no default value.
- Previous by thread: Parameter ?_1 has no default value.
- Next by thread: Re: Too many arguments in Stored Proc (VB6)
- Index(es):
Relevant Pages
|
|