Passing variant arrays or arrays of variants - how

Results 1 to 2 of 2

Thread: Passing variant arrays or arrays of variants - how

  1. #1
    Ian Smith Guest

    Default Passing variant arrays or arrays of variants - how

    Help! I have a VB COM component used to "validate" an array of telephone numbers. The array can have holes in it because it&#039s populated from drop-down list-box of "phone number type"s like those used in Microsoft Outlook. <BR><BR>Any attempt to invoke the component from an ASP page just causes a "Type Mismatch" error, but from a VB test module it&#039s fine. Note that variants have been used throughout and I&#039ve read every Knowledgebase article about ASP only using variants until I&#039m red in the face - nothing has helped. The ASP page still refuses to pass the data across to the COM component. I have tried every combination of array variants, variants as arrays etc I can think of, but am getting absolutely nowhere.<BR><BR>The COM component is coded to expect the following....<BR><BR> Public Function Validate(TelArray() As Variant, _<BR> ErrMsg As Variant) _<BR> As Boolean <BR><BR>The "test case" written to use variants and which works fine from VB is as follows...<BR><BR> Dim varInput(3, 4) As Variant<BR> Dim strErrMsg<BR> Dim blnRowCount<BR> varInput(0, 0) = "1"<BR> varInput(1, 0) = "+44"<BR> varInput(2, 0) = "01628"<BR> varInput(3, 0) = "413688"<BR> varInput(0, 1) = "2"<BR> varInput(1, 1) = "+44"<BR> varInput(2, 1) = "0410"<BR> varInput(3, 1) = "999999"<BR> varInput(0, 2) = "2"<BR> varInput(1, 2) = "+44"<BR> varInput(2, 2) = "01628"<BR> varInput(3, 2) = ""<BR> varInput(0, 3) = "4"<BR> varInput(1, 3) = "+44"<BR> varInput(2, 3) = "01628"<BR> varInput(3, 3) = ""<BR> varInput(0, 4) = "5"<BR> varInput(1, 4) = "+44"<BR> varInput(2, 4) = "01628"<BR> varInput(3, 4) = ""<BR> MsgBox "TypeName =" & TypeName(varInput)<BR> Set objBus = CreateObject("BonvenoBus.TelRequest")<BR> blnRowCount = objBus.Validate(varInput, strErrMsg)<BR><BR>The same code (without the MsgBox because VBScript doesn&#039t support the "TypeName" function) gives "Type Mismatch" on the last line when run in an ASP page. I&#039ve tried co-ercing the damned array into a single variant, as hinted at in "Advanced VB". Nothing. I&#039ve done every thing there is to be done with ParamArray. Still no joy. Surely there has to be a way to get this damned thing so it works with VB AND ASP.<BR><BR>Typename reveals "Variant()" when run in VB. Using the ASP debugger the "varInput" structure shows as "Array of variant" in the Watch window.<BR><BR>Help!<BR><BR>Ian

  2. #2
    Brian Rhee Guest

    Default RE: Passing variant arrays or arrays of variants -

    Check this site out, hope it helps.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts