|
-
Jul 21st, 2003, 02:25 PM
#1
Thread Starter
New Member
Return value of a stored proc
i have this stored proc
CREATE Procedure dbo.spGetReport(@CourtierID int, @TypeFile varchar(100)) As
Declare @ID int
Select inforapportid, date_debut_periode, date_fin_periode, date_fichier_genere, no_courtier, nom_courtier, no_agent_general, nom_agent_general, no_courtier_autre, nom_courtier_autre, TypeFichier
From InfoRapportRAPFND
Where [no_courtier] = @CourtierID and [typefichier] = @TypeFile
select @ID = inforapportid
From InfoRapportRAPFND
Where [no_courtier] = @CourtierID and [typefichier] = @TypeFile
Return @ID
GO
and there is my code that call this stored proc
With mlpCmd
.ActiveConnection = mlpCNClient
.CommandText = "spGetReport"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue)
.Parameters.Append .CreateParameter("CourtierID", adInteger, adParamInput)
.Parameters.Append .CreateParameter("TypeFichier", adBSTR, adParamInput)
End With
this append the parameters to the command
With mlpCmd
'Set parameters values
With .Parameters
.Item("CourtierID").Value = CourtierID
'.Item("TypeFichier").Value = TypeFile
End With
'Execute and Retrieve RS
Set lpRSInfoRapport = .Execute()
lngReportID = .Parameters.Item("RETURN_VALUE").Value
End With
so the stored proc doesnt return me anything but if i build a select whit the same syntax it returns me something, and if i remove the parameter TypeFichier it returns me something too..
can someone helps me to find the problem?
thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|