Type Mismatch while accessing com from ASP

Results 1 to 2 of 2

Thread: Type Mismatch while accessing com from ASP

  1. #1
    Srinivas Naidu Malla Guest

    Default Type Mismatch while accessing com from ASP

    I wrote a COM component which returns array and string. I am passing them by ref and data type is varient.It is working very fine when i call from vb standard exe.But when i called it from ASP it is showing data type mismatch. Component code is<BR><BR> Public Function blnGetCurrentActivity(ByVal Report_ID As String, ByRef retArray As Variant, ByRef gstrErr As String, ByRef recCount As Integer) As String.Please look into it and give me solution<BR><BR>Thanks,<BR>Srinivas<BR> <BR> Dim strRep_ID As String<BR> Dim i As Integer<BR> Dim strstrReq_ID() As String<BR> Dim strsql As String<BR> Dim RsRequest As ADODB.Recordset<BR> Dim statusvalue() As String<BR> <BR> On Error GoTo blnGetCurrentActivityError<BR> <BR> strRep_ID = Trim$(Report_ID)<BR> strsql = "select a.User_ID,a.DateTime_Submitted,a.DateTime_Finished , b.Param_Value From OR_REQUEST_MASTER a, OR_Request_Details b where a.Request_id = b.Request_ID and a.Report_ID =&#039;" & strRep_ID & "&#039; and a.Req_Status_Code in (&#039;1&#039;,&#039;2&#039;) order by DateTime_Submitted desc"<BR> &#039;strsql = "SELECT b.Param_Value FROM OR_Master AS c INNER JOIN OR_Request_Master AS a ON c.Report_ID = &#039;" & 1 & "&#039; INNER JOIN OR_Request_Details AS b ON a.Request_ID = b.Request_ID"<BR> <BR> Set RsRequest = New ADODB.Recordset<BR> blnGetConnection<BR> <BR> If IsObject(cnnODSReport) Then<BR> <BR> RsRequest.Open strsql, cnnODSReport, adOpenStatic, adLockOptimistic<BR> recCount = RsRequest.RecordCount<BR> <BR> If recCount &#060;&#062; 0 Then<BR> <BR> If Not IsArray(retArray) Then<BR> <BR> ReDim retArray(3, 0)<BR> <BR> Else<BR> <BR> <BR> ReDim Preserve retArray(3, recCount)<BR> <BR> End If<BR> <BR> retArray = RsRequest.GetRows<BR> blnGetCurrentActivity = "True"<BR> <BR> <BR> <BR> &#039;For i = 0 To RsRequest.recordcount - 1<BR> <BR> &#039; retUser(i) = RsRequest.Fields("User_ID")<BR> &#039;retFrom(i) = RsRequest.Fields("DateTime_Submitted")<BR> &#039;retTo(i) = RsRequest.Fields("DateTime_Submitted")<BR> &#039;paramValue(i) = RsRequest.Fields("Param_Value").OriginalValue<BR> &#039;RsRequest.MoveNext<BR> <BR> &#039;Next<BR> <BR> Else<BR> <BR> gstrErr = "ReportDBTrans.blnGetCurrentActivity(),There is No CurrentActivity for this report"<BR> Error_Log (Trim$(gstrErr))<BR> blnGetCurrentActivity = "False"<BR> <BR> End If<BR> Else<BR> <BR> gstrErr = "Error in ReportDBTrans.blnGetCurrentActivity(),Connection to the database could not be established"<BR> Error_Log (Trim$(gstrErr))<BR> blnGetCurrentActivity = "False"<BR> <BR> End If<BR> <BR> If IsObject(cnnODSReport) Then<BR> <BR> CloseConnection<BR> <BR> End If<BR> <BR> If Not RsRequest Is Nothing Then<BR> <BR> If RsRequest.State = adStateOpen Then<BR> RsRequest.Close<BR> End If<BR> <BR> Set RsRequest = Nothing<BR> <BR> End If<BR> <BR> Exit Function<BR> <BR>blnGetCurrentActivityError:<BR> gstrErr = "Error in ReportDBTrans.blnGetCurrentActivity(),Error Occured in blnGetCurrentActivity Function"<BR> Error_Log (Trim$(gstrErr))<BR> blnGetCurrentActivity = "False"<BR>End Function

  2. #2
    Steve Cimino Guest

    Default RE: Type Mismatch while accessing com from ASP

    Pass all your values in ByVal, and don&#039;t return a String() array. Just return a variant, and this will clear up all your problems.

Posting Permissions

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