Asp.Net/Com+ Integration problem

Zettian

New Member
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><%@ Page Language="VB" aspcompat=true Debug="true" %><BR><%@ Import Namespace="System.Data" %><BR><%@ Import Namespace="System.Data.oleDb" %><BR><BR><BR><script language="VB" runat=server><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> 'The code fails here:<BR> myDA.Fill(myDS,objTest)<BR> End Sub<BR></script><BR><BR>The error generated is:<BR><BR>Exception Details: System.InvalidCastException: Cast from type 'Recordset' to type 'String' is not valid.<BR><BR>Can anyone help? I've spent half a day trying to figure this out.<BR>Many thanx in advance.What line is generating the error?? What does oTimesheet.Retrieve(6) return?
 
Back
Top