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