Arpan wrote:
Microsoft advises not to pass parameters to the Command object in the
Execute statement. Why?
Where did you see this advice? It's hard to answer such a question in a
vacuum.
One possible reason is the "late-bound"/"early-bound" argument. In compiled
languages such as VB, C++, etc. using variants (which is ultimately what you
are doing when you pass a variant array containing parameter values via the
Execute statement) impairs performance. However, in vbscript, ALL variables
are Variant, so this is not as much a consideration. As Eric Lippert
constantly says: "if you care about maximizing performance, using a
late-bound unoptimized bytecode-interpreted dynamically-typed language is
probably a bad choice." Of course, he fails to address that script languages
are pretty much the only choice in classic ASP, even when using your own
compiled dll's (you have to use script to instantiate them, don't you?)
The other reason of course, is that retrieving output parameter values is
not possible when using this method to pass parameter values to a stored
procedure.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"