I have an issue with ParamArray. This is supposed to be OPTIONAL by default but it seems it is not so.
I have the following code in an ASP page.
dim oUtil, sSQL, oRs, bCARS
Set oUtil = server.CreateObject("CPUtility.Feature")
sSql = "select CARSFlag from Version"
set oRs = oUtil.Execute("", sSql)
Then in my COM class I have the following definition
Public Function Execute(ByVal oDBConnection As Object, ByVal sSQL As String, ByVal ParamArray avParameters() As Object) As ADODB.Recordset
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.
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))
I don't understand why omitting the ParamArray parameter would result in the method not found/supported.
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