If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Stored Proc Output Param Empty

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-03, 18:13
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Stored Proc Output Param Empty

I've created a stored procedure that takes one input parameter and returns one output parameter and a recordset.

The SP looks like this (I trimmed it a bit for readability):
Code:
CREATE PROCEDURE dbo.spEligibleProducts 

  @prmProdCode nvarchar(20),
  @prmTotalCount int Output

AS

  SELECT * FROM tblProducts WHERE cProdCode = @prmProdCode

  SELECT @prmTotalCount = @@ROWCOUNT
GO
My ASP which executes the ASP looks like this:
Code:
objDataCmd_TD.CommandText="spEligibleProducts"  'query name
objDataCmd_TD.CommandType=adCMDStoredProc  'con connection type
objDataCmd_TD.Parameters.Append objDataCmd_TD.CreateParameter("@prmProdCode", adVarWChar, adParamInput, 20 , sProdCode)
objDataCmd_TD.Parameters.Append objDataCmd_TD.CreateParameter("@prmTotalCount", adInteger, adParamOutput)

set objTempRS = objDataCmd_TD.Execute 'Execute into temporary recordset

iTotalRows = objDataCmd_TD.Parameters("@prmTotalCount") 'Store total rows
sProdCode is defined elsewhere as the Product Code, and iTotalRows is also defined elsewhere to receive the value of the output parameter. The output param is rows returned in the first SELECT of the stored procedure.

When I execute the SQL from a query analyzer, the proper value is returned. When this executes from ASP, iTotalRows is empty. No value at all.

The goal is to get the total records returned, and the recordset from the first query to be traversed after the execution of the SP.

Any ideas?
Reply With Quote
  #2 (permalink)  
Old 08-25-03, 19:19
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
It may help to know that the provider is "SQLOLEDB"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On