In Microsoft Knowledge Base article Q217114
, "How to: Implement Array Arguments in Visual Basic COM Objects for Active Server Pages," Microsoft says you can't pass an array to a COM method by value. However, you want to do this for Microsoft Transaction Server (MTS), so here is a workaround that does it ByVal. Add a file called test.asp with this Active Server Page (ASP) code to a virtual Internet Information Server (IIS) directory:
ary(0) = "firstone"
ary(1) = "2ndone"
' pass the array to a non array declared variable then
' pass the non array variable instead
PassArrayByValWorks = ary
set obj = server.createobject ("prjFormCheck.clsFormCheck")
iReturn = obj.formcheck(PassArrayByValWorks, 0)
' build ActiveX dll named "prjFormCheck", name
' class "clsFormCheck" add the function below
' and start it in the VB IDE
Public Function FormCheck(ByVal _
arrFldNameValuePairs As Variant, ByVal _
ErrLogType As Variant) As Variant
If IsArray(arrFldNameValuePairs) Then
FormCheck = "You can do it!"
FormCheck = "Didn't work"
Right-click on the test.asp file in the virtual directory of IIS and click on Browse. The browser should show "You can do it!"