Interop Problem

JoeIngle

New member
Joined
Dec 2, 2003
Messages
1
Hi Peeps

Im trying to pass a few arrays from an asp page to a vn.net function and keep getting the error:

Invalid procedure call or argument

I understand this is because vb.net has the problem. In VB6 Id have declared the datatypes as Variant, so have tried using Object in vb.net, but no joy.

I should mention that the .net assembly is registered in the GAC, and I have several other routines running perfectly between asp and asp.net, so its definatly my code.

Has anyone any advice on this?

ASP code as follows:

Dim strParamName()
Dim strParamValue()
Dim strParamDataType()
Dim strParamSize()

ReDim Preserve strParamName(0)
ReDim Preserve strParamValue(0)
ReDim Preserve strParamDataType(0)
ReDim Preserve strParamSize(0)

strParamName(0) = "@UserID"
strParamValue(0) = "31"
strParamDataType(0) = "2"
strParamSize(0) = "4"

ReDim Preserve strParamName(1)
ReDim Preserve strParamValue(1)
ReDim Preserve strParamDataType(1)
ReDim Preserve strParamSize(1)

strParamName(1) = "@UserID"
strParamValue(1) = "41"
strParamDataType(1) = "2"
strParamSize(1) = "4"

Set objIntParam = Server.CreateObject("InteropServer.InteropServer")

Set objRS2 = objIntParam.ExecuteSPWithParams("Pr_InteropTest" , "5" , strParamName , strParamValue , strParamDataType , strParamSize , True , strErrNum , strErrDesc)

If strErrDesc <> "" Then

Response.Write "<font face=""arial"" color=""#ff0000"">The following error occured:<br /><br />" & "Error Number = " & lngErrNum & "<br />Error Description = " & strErrDesc & "</font>"

Else

Do While objRS2.EOF = False

Response.Write Trim(objRS2.Fields(0).Value & "") & ", " & Trim(objRS2.Fields(1).Value & "") & "<br><hr><br>"

objRS2.MoveNext

Loop

End If

Set objInt1 = Nothing
Set objRS2 = Nothing

DOT.NET Function:

Public Function ExecuteSPWithParams(ByVal p_strSQL As String, ByVal p_strRole As String, ByRef p_strParameterNames As Object(), ByRef p_objParameterValues As Object(), ByRef p_strDataType As Object(), ByRef p_strDataTypeSize As Object(), ByVal p_blnParametersPassed As Boolean, ByRef Return_ErrNum As String, ByRef Return_ErrDesc As String) As ADODB.Recordset


Blah
Blah

End Function

TIA

Joe

:confused:
 
Back
Top