Akademos
May 17th, 2001, 08:39 AM
Hi,
i have a stored procedure which i declared this way:
CREATE PROCEDURE dbo.sp_anzRomaneProAutor @name text, @anz int output AS
SELECT @anz= count(*)
FROM Roman INNER JOIN
Mitarbeiter ON Roman.Autor = Mitarbeiter.ID
WHERE (Mitarbeiter.Name LIKE @name)
GO
Now i wrote a little basic-application to call this procedure:
set rsPRAutor = cmPR.Execute
set pmPRAutorName = cmPR.CreateParameter("@Name", adBSTR, adParamInput)
cmPR.Parameters.Append pmPRAutorName
set pmPRAutorAnz = cmPR.CreateParameter("@anz", adInteger, adParamOutput)
cmPR.Parameters.Append pmPRAutorAnz
rsPRAutor.MoveFirst
While (Not rsPRAutor.EOF)
'Anzahl der Romane pro Autor lesen
cmPR.CommandText = "sp_anzRomaneProAutor"
cmPR.CommandType = adCmdStoredProc
pmPRAutorName.Value = rsPRAutor.Fields(0)
set rsPRAnz = cmPR.Execute
rsPRAutor.MoveNext
Wend
but if i watch thr pmPrAutorAnz and the rsPRAnz-Object there a no values field in. The count of fields of rsPRAnz is 0 and pmPrAutorAnz is also 0.
What have i done wrong? How can i call a stored procedure within VB and receive the result of the procedure?
Thanks
akademos
i have a stored procedure which i declared this way:
CREATE PROCEDURE dbo.sp_anzRomaneProAutor @name text, @anz int output AS
SELECT @anz= count(*)
FROM Roman INNER JOIN
Mitarbeiter ON Roman.Autor = Mitarbeiter.ID
WHERE (Mitarbeiter.Name LIKE @name)
GO
Now i wrote a little basic-application to call this procedure:
set rsPRAutor = cmPR.Execute
set pmPRAutorName = cmPR.CreateParameter("@Name", adBSTR, adParamInput)
cmPR.Parameters.Append pmPRAutorName
set pmPRAutorAnz = cmPR.CreateParameter("@anz", adInteger, adParamOutput)
cmPR.Parameters.Append pmPRAutorAnz
rsPRAutor.MoveFirst
While (Not rsPRAutor.EOF)
'Anzahl der Romane pro Autor lesen
cmPR.CommandText = "sp_anzRomaneProAutor"
cmPR.CommandType = adCmdStoredProc
pmPRAutorName.Value = rsPRAutor.Fields(0)
set rsPRAnz = cmPR.Execute
rsPRAutor.MoveNext
Wend
but if i watch thr pmPrAutorAnz and the rsPRAnz-Object there a no values field in. The count of fields of rsPRAnz is 0 and pmPrAutorAnz is also 0.
What have i done wrong? How can i call a stored procedure within VB and receive the result of the procedure?
Thanks
akademos