Asp.Net/Com+ Integration problem

Results 1 to 2 of 2

Thread: Asp.Net/Com+ Integration problem

  1. #1
    Join Date
    Dec 1969

    Default Asp.Net/Com+ Integration problem

    Howdy,<BR><BR>I have an existing Com+ component written in VB6 which I would like to access from an aspx page.<BR><BR>The method I want to access in the Com+ class is:<BR><BR>Public Function Retrieve(ByVal iTimeSheetID As Integer) As ADODB.Recordset<BR><BR>The component works fine when called from Access 2000 or a VB6 GUI.<BR><BR>The aspx code:<BR><BR>&#060;%@ Page Language="VB" aspcompat=true Debug="true" %&#062;<BR>&#060;%@ Import Namespace="System.Data" %&#062;<BR>&#060;%@ Import Namespace="System.Data.oleDb" %&#062;<BR><BR><BR>&#060;script language="VB" runat=server&#062;<BR> <BR> Sub Page_Load(Sender As Object, E as EventArgs)<BR> Dim oTimesheet = Server.CreateObject("Contractor.CTimesheet")<BR> Dim objTest = oTimesheet.Retrieve(6)<BR> Dim myDS As DataSet = New DataSet<BR> Dim myDA As OleDbDataAdapter = New OleDbDataAdapter<BR> <BR> &#039;The code fails here:<BR> myDA.Fill(myDS,objTest)<BR> End Sub<BR>&#060;/script&#062;<BR><BR>The error generated is:<BR><BR>Exception Details: System.InvalidCastException: Cast from type &#039;Recordset&#039; to type &#039;String&#039; is not valid.<BR><BR>Can anyone help? I&#039;ve spent half a day trying to figure this out.<BR>Many thanx in advance.

  2. #2
    Join Date
    Dec 1969

    Default RE: Asp.Net/Com+ Integration problem

    What line is generating the error?? What does oTimesheet.Retrieve(6) return?

Posting Permissions

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