When I run this stored procedure:
CREATE PROC testCDs
@TotalRecs int OUTPUT
AS
SELECT cdID, cdFirstName, cdLastName, cdCompany FROM tviCDs
SELECT @TotalRecs = @@ROWCOUNT
in this code:
objCommand = Server.CreateObject("ADODB.Command"
objCommand.ActiveConnection = connTviDB
objCommand.CommandType = adCmdStoredProc
objCommand.CommandText = "testCDs"
objCommand.Parameters.Append(objCommand.CreateParameter("@TotalRecs",adInteger,adParamOutput))
rsSearch = objCommand.Execute();
totalRecs = objCommand.Parameters("@TotalRecs"
Response.Write("'" + totalRecs + "'"
my code returns 'undefined'. So it does not recieve a value from a stored procedure.
Have anyone had any experience with Sprocs returning recordser along with some output parameters? I have no clue what the problem might be...
Even when I replace
SELECT @TotalRecs = @@ROWCOUNT
with, say
SELECT @TotalRecs = 1
I still get the same thing - undefined.
Hope you can help.
Thanks in advance.. <Dmitriy>
dbrom@crosswinds.net
CREATE PROC testCDs
@TotalRecs int OUTPUT
AS
SELECT cdID, cdFirstName, cdLastName, cdCompany FROM tviCDs
SELECT @TotalRecs = @@ROWCOUNT
in this code:
objCommand = Server.CreateObject("ADODB.Command"
objCommand.ActiveConnection = connTviDB
objCommand.CommandType = adCmdStoredProc
objCommand.CommandText = "testCDs"
objCommand.Parameters.Append(objCommand.CreateParameter("@TotalRecs",adInteger,adParamOutput))
rsSearch = objCommand.Execute();
totalRecs = objCommand.Parameters("@TotalRecs"
Response.Write("'" + totalRecs + "'"
my code returns 'undefined'. So it does not recieve a value from a stored procedure.
Have anyone had any experience with Sprocs returning recordser along with some output parameters? I have no clue what the problem might be...
Even when I replace
SELECT @TotalRecs = @@ROWCOUNT
with, say
SELECT @TotalRecs = 1
I still get the same thing - undefined.
Hope you can help.
Thanks in advance.. <Dmitriy>
dbrom@crosswinds.net