title: COM and ParamArray
body: <p>I have an issue with ParamArray. This is supposed to be OPTIONAL by default but it seems it is not so.</p>
  
  <p>I have the following code in an ASP page.</p>
  
  <pre><code>dim oUtil, sSQL, oRs, bCARS
  
  Set oUtil = server.CreateObject("CPUtility.Feature")
  sSql = "select CARSFlag from Version"
  set oRs = oUtil.Execute("", sSql)
  </code></pre>
  
  <p>Then in my COM class I have the following definition</p>
  
  <pre><code>Public Function Execute(ByVal oDBConnection As Object, ByVal sSQL As String, ByVal ParamArray avParameters() As Object) As ADODB.Recordset
  </code></pre>
  
  <p>This result in an error where Execute method is not found/supported. But if I modify the Execute method in the ASP page to pass something to the ParamArray then it works just fine.</p>
  
  <pre><code>dim oUtil, sSQL, oRs, bCARS
  
  Set oUtil = server.CreateObject("CPUtility.Feature")
  sSql = "select CARSFlag from Version WHERE dbLanguage=? AND UtilityUpgrade=?"
  set oRs = oUtil.Execute("", sSql, _
      Array("lang", adVarchar, adParamInput, 1, "E"), _
      Array("bit", adBoolean, adParamInput, 0, 1))
  </code></pre>
  
  <p>I don't understand why omitting the ParamArray parameter would result in the method not found/supported.</p>
  
  <p>This is using .NET 4.6.2 and the class is registered in the GAC using GACUTIL and all entries have been added to the registry using REGASM</p>