Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP(Vbscript) to access SQL sproc's output parameter
Message
 
 
À
Tous
Information générale
Forum:
Internet
Catégorie:
Active Server Page
Titre:
ASP(Vbscript) to access SQL sproc's output parameter
Divers
Thread ID:
00396347
Message ID:
00396347
Vues:
52
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
Répondre
Fil
Voir

Click here to load this message in the networking platform