Hi Peeps
I'm trying to pass a few arrays from an asp page to a
vb.net function and keep getting the error:
Invalid procedure call or argument
I understand this is because
vb.net has the problem. In VB6 I'd 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.
Has anyone any advice on this?
ASP code as follows:
Dim strParamName()
Dim strParamValue()
Dim strParamDataType()
Dim strParamSize()
ReDim strParamName(0)
ReDim strParamValue(0)
ReDim strParamDataType(0)
ReDim strParamSize(0)
strParamName(0) = "@UserID"
strParamValue(0) = "31"
strParamDataType(0) = "2"
strParamSize(0) = "4"
ReDim strParamName(1)
ReDim strParamValue(1)
ReDim strParamDataType(1)
ReDim 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 "The following error occured:
" & "Error Number = " & strErrNum & "
Error Description = " & strErrDesc & ""
Else
Do While objRS2.EOF = False
Response.Write Trim(objRS2.Fields(0).Value & "") & ", " & Trim(objRS2.Fields(1).Value & "") & "<br><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 String, ByRef p_objParameterValues() As String, ByRef p_strDataType() As String, ByRef p_strDataTypeSize() As String, ByVal p_blnParametersPassed As Boolean, ByRef Return_ErrNum As String, ByRef Return_ErrDesc As String) As ADODB.Recordset
Blah
Blah
End Function
I haven't included all the function code as that's not the problem. I basically need to whether it's possible to pass a 1 dimensional array to a
vb.net function from asp.
TIA
Joe