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 > Displaying SPROC returned values in asp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-03, 07:59
sisi sisi is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Displaying SPROC returned values in asp

Hello,
I have the following SPROC on my SQL 7.0 DB:

ALTER procedure Stuff
(
@tran_dateStart datetime,
@tran_dateEnd datetime,
@tran_Count int OUTPUT
)

AS

SELECT txn_amt FROM xfrq WHERE res_code = '000' and i_xf_date BETWEEN @tran_dateStart AND @tran_dateEnd

SELECT @tran_Count = COUNT(txn_amt) FROM xfrq WHERE res_code = '000' and i_xf_date BETWEEN @tran_dateStart AND @tran_dateEnd

GO


I would like to display the values for @tran_Count in an asp page, as well as all the records pulled from the db by the SPROC. I have the following asp page:

Dim oConn
Dim oCmd
Dim objRS
Dim StartDate
Dim EndDate
Dim N
Dim R
Dim RowColor
Dim Count

Set oCmd = Server.CreateObject("ADODB.Command")
Set objRS = Server.CreateObject("ADODB.Command")

StartDate = Request.Form("From")
EndDate = Request.Form("To")

Set oCmd.ActiveConnection = oConn

oCmd.CommandText = "Stuff"
oCmd.CommandType = adCmdStoredProc
oCmd.Parameters.Append oCmd.CreateParameter("@tran_dateStart", adDBTimeStamp, adParamInput, 22)
oCmd.Parameters.Append oCmd.CreateParameter("@tran_dateEnd", adDBTimeStamp, adParamInput, 22)

oCmd.Parameters.Append oCmd.CreateParameter("@tran_Count", adInteger, adParamOutput)

oCmd.Parameters("@tran_dateStart") = StartDate
oCmd.Parameters("@tran_dateEnd") = EndDate

Set objRS = oCmd.Execute

Count = oCmd.Parameters("@tran_Count")

<Body>
<%= Count%>
</Body>

Somehow i don't get the figure for the count when i pass parameters to this page. Anyone have any suggestions? Thanks

Last edited by sisi; 12-04-03 at 11:34.
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