Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return values out of user-defined function that access DB

Status
Not open for further replies.

BG12424

Programmer
Jun 4, 2002
717
US
I am calling this function from another asp page and it is bombing on me. Any Ideas on how I can get this to work and return the value of the return code to me, or true if it successfully deleted the quote? Thanks in advance

function WV_DeleteQuotePortfolio(userid,symbol)
' replace act_WVDeleteQuotePortfolio.cfm

dim cmd, dbConn, retval
dbConn = GetConnection

Set cmd = Server.CreateObject("ADODB.Command")
with cmd
.ActiveConnection = dbConn
.CommandText = "WVDeleteQuotePortfolio"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("RETURN_VALUE", adInteger,adParamReturnValue)
.Parameters.Append .CreateParameter("@userid",adInteger,adParamInput, ,userid)
.Parameters.Append .CreateParameter("@symbol",adVarChar,adParamInput, ,symbol)
.Execute , , adExecuteNoRecords
retval = .Parameters("RETURN_VALUE")
end with

select case retval
case 1
WV_DeleteQuotePortfolio = "User not valid"
case 4
WV_DeleteQuotePortfolio = "User does not have this quote in his or her portfolio"
case else
WV_DeleteQuotePortfolio = ""
end select

Set cmd = Nothing
CloseDBConn(dbConn)

end function regards,
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top