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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax for returning output value from sproc

Status
Not open for further replies.

arkadia93

Programmer
Oct 19, 2006
110
GB
What is the correct syntax for returning an output value from a stored procedure? I have tried the following without success...the name of my output parameter is 'EmailAddress' in the stored proc. Can anybody help me out?

dim ObjConnGetManagerEmail,ObjCommGetManagerEmail,ObjRsetGetManagerEmail
set ObjConnGetManagerEmail = server.CreateObject("ADODB.connection")
set ObjRsetGetManagerEmail = server.CreateObject("ADODB.Recordset")
Set ObjCommGetManagerEmail = server.CreateObject("ADODB.Command")
ObjConnGetManagerEmail.Open strConn
ObjCommGetManagerEmail.ActiveConnection = ObjConnGetManagerEmail
ObjCommGetManagerEmail.CommandType = 4
ObjCommGetManagerEmail.CommandText = "GetManagerEmailAddress"
ObjCommGetManagerEmail.Parameters.Refresh
ObjCommGetManagerEmail.Parameters(1).Value = Session("LoginID")

ObjCommGetManagerEmail.Parameters(2).Direction = adParamOutput
dim EmailAddress = ObjCommGetManagerEmail.Parameters(2).Value
ObjCommGetManagerEmail.Execute
set ObjCommGetManagerEmail = nothing
set ObjConnGetManagerEmail = nothing
 
Possibly you need to execute the stored procedure before you can obtain a value for an output parameter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top