Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP(Vbscript) to access SQL sproc's output parameter
Message
From
24/07/2000 17:03:19
 
 
To
All
General information
Forum:
Internet
Category:
Active Server Page
Title:
ASP(Vbscript) to access SQL sproc's output parameter
Miscellaneous
Thread ID:
00396347
Message ID:
00396347
Views:
51
Code looks something like (connection is defined above):

ps_SQL="exec StoreProcedure"&_
"@InputParam = ? ," &_
"@OutputParam = ? output"

Set Cmd1 = Server.CreateObject("ADODB.Command")
Cmd1.ActiveConnection = Conn
Cmd1.CommandText = ps_SQL
Set Param1 = Cmd1.CreateParameter(,3,1)
Param1.value= someValue
Cmd1.Parameters.Append Param1
Set Param1 = Nothing

Set Param2 = Cmd1.CreateParameter(,3,2)
Cmd1.Parameters.Append Param2
Set Param2 = Nothing

Set Rs = Cmd1.Execute()
Response.Write "Cmd1.Parameters(0).Value=" & Cmd1.Parameters(0).Value
Response.Write "Cmd1.Parameters(1).Value=" & Cmd1.Parameters(1).Value
Response.End

Output for Parameters(0) is as expected though for Parameters(1) output is blank.
StoreProcedure returns what is expected, when run from analyzer.

What is wrong in the code?
Or maybe somebody can point me to the code that works?
Thanks in advance.
Anatoliy
Reply
Map
View

Click here to load this message in the networking platform