In my opinion:
The command object allows you to use the prepared statement multiple times,
and get output parameters and to use named parameters. connection.execute
only allows an array of parameters and the return value, but no output
parameters. So for a one time shot with no output parameters you can use
command.execute for less code. For multi-use or to receive output
parameters or to have named parameters (easier for readability and
maintainability than the parameter array of connection.execute) then the
command object is better.
Brian Freeman
-----Original Message-----
From: Alex Smotritsky [mailto:alex.smotritsky@v...]
Sent: Saturday, December 14, 2002 12:23 AM
To: sql language
Subject: [sql_language] RE: Passing output from a stored procedure
Command has more power, I don't think u can call a stored procedure from
ado without it.
-----Original Message-----
From: Enzo Zaragoza [mailto:enzaux@g...]
Sent: Friday, December 13, 2002 11:39 PM
To: sql language
Subject: [sql_language] RE: Passing output from a stored procedure
Speaking of Connection.Execute and ADO Command, which is better
to use or when is the other applicable to use than the other one?
Thanks,
enzo c",)T
http://www.tropangwatakwatak.tk
-----Original Message-----
From: Brian Freeman [mailto:freeman@C...]
Sent: Friday, December 13, 2002 10:52 PM
To: sql language
Subject: [sql_language] RE: Passing output from a stored procedure
Are you using ADO or ADO.net? If so use either connection.execute or a
command object with parameters. As your code is now it just passes in
the value of "Grade" and "salary" not pointers to them. There have been
previous posts on using ADO command object plus there are lots of
examples from microsoft.
Good luck.
Brian Freeman
(xxx) xxx-xxxx ext. 415
Carnegie Technologies/Bluewave Computing
www.carnegie.com and www.bluewave-computing.com
-----Original Message-----
From: Ntshalintshali Neliso [mailto:Ntshalintshalin@f...]
Sent: Friday, December 13, 2002 5:02 AM
To: sql language
Subject: [sql_language] Passing output from a stored procedure
I am calling a stored procedure in VBScript, the stored proc has been
defined with two fields as output. When I try to execute the call to the
proc I get the following error :
"Cannot use the OUTPUT option when passing a constant to a stored
procedure."
Is it in the way I am concatenating the call statement in the VBscript
SQLQuery = "us_AddEmployee " & _
" '" & lcase(Request.Form("Name")) & "', " & _
" '" & Request.Form("Initials") & " " &
Request.Form("AddSurname")& "', " & _
" '" & Request.form("Department") & "', " & _
" '" & session("database") & "', " & _
" '" & Request.Form("Grade") & "' Output, " & _
" '" & Request.Form("Salary") & "' Output "
But the "Grade" and the "Salary" are fileds from a form, not constants,
even when I replace them with variables declared in VBScript, I get the
same error.
Is there something I am doing wrong?
Regards,
Neliso.
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to