As I was saying before this procedure does not work
Public Function ExecuteSP(sProcName As String, ParamArray aParams()) As ADODB.Recordset
Dim objCMD As ADODB.Command
Set objCMD = New ADODB.Command
.ActiveConnection = Conn
.CommandText = sProcName
.CommandType = adCmdStoredProc
If aParams(0) Is Nothing Then
Set ExecuteSP = .Execute
Set ExecuteSP = .Execute(, aParams)
Set objCMD = Nothing
What I'm trying to accomplish is pass an array of parameters and within the proc or function is to loop through the parameter names using the following:
.Parameters.Append .CreateParameter(PARAM2, adVarChar, adParamInput, FS2, ParamValue2)
I'm not an expert with the Command object to know all the methods and properties. My question is instead of writing my own array method, etc. Is there a method already prewritten that I can use? For example, in ADO I like to use the arrays to loop through recordsets, intially I was writing my own arrays to loop through recordsets before I found the "getrows" method which does the same thing.
I have not be successful at finding good examples of all the methods and properties of the Command object. I hope I'm making some sense.