
Using Parameters.Refresh with Oracle & ado 2.6
I had a hard time figuring out how to use Parameters.Refresh with
Oracle and ADO 2.6 (provider = msadora.1), so I thought I'd post the
solution I came up with here:
Set ocmd = New ADODB.Command
With ocmd
Set .ActiveConnection = moConn
.CommandText = "{CALL myPackage.mySp(?)}"
.CommandType = adCmdText
.Parameters.Refresh
End With
I found after doing this I could inspect the Parameters collection
and see all the parameters defined. My initial testing also shows you
_don't_ have to supply a "?" for each parameter. I've tested this
with an SP with five parameters, and it added all five parameters to
my Parameters collection even though I only passed the one "?".
The wisdom in using Parameters.Refresh has been discussed ad nauseum
on Usenet. For what I needed to do it was the logical approach. In
an SP where the parameter count and types are unchanging,
Parameters.Refresh wouldn't be a wise thing to do.