Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"type mismatch" error while passing an array as an paramter to a Func

Status
Not open for further replies.
Aug 16, 2001
26
0
0
NZ
I'm calling a VB (DLL) component from a ASP page. I need to pass an array as input parameter to my Function in the VB component. But when I do this, I'm getting a "type mismatch" error. Can somebody tell me where i have gone wrong. I have also included my code below.

My ASP page...
*************
Dim myAdHocObj
Dim retVal
Dim frmSF_TblDtlsStrArr(1000, 2)
Dim frmSF_ColDtlsStrArr(1000, 1000, 1)

Set myAdHocObj = Nothing
Set myAdHocObj = Server.CreateObject("ebixAdhocRpt6.cls_Fetch_TblNCol_Dtls")

retVal = myAdHocObj.F_Fetch_TblNCol_Dtls(frmSF_TblDtlsStrArr, frmSF_ColDtlsStrArr)



My VB Component...
*****************
Public Function F_Fetch_TblNCol_Dtls(pTblDtlsStrArr, pColDtlsStrArr) As String
...
...
...
End Function
 
Belive it or not, this should make a difference.

Dim frmSF_TblDtlsStrArr
Dim frmSF_ColDtlsStrArr

ReDim frmSF_TblDtlsStrArr(1000, 2)
ReDim frmSF_ColDtlsStrArr(1000, 1000, 1)

The difference is that your code created an Array of Variants whereas the Redim creates an Array inside a variant. I've forgotten if the parameter in the DLL must be defined as
arrayname()
or just
arrayname.
Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Thanks ! It finally worked. I coded as below...

My VB Component
*****************
Public Function F_Fetch_TblNCol_Dtls(ByRef pTblDtlsStrArr As Variant, ByRef pColDtlsStrArr As Variant) As String
...
...
...
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top