I have created a little project to test this and have no problems:
Client: Standard EXE
Here I declare a Connection and Recordset object (ADO)
I connect and retreive a recordset from the DB. OK
Then I call MyDll with rs as the parameter as follows:
Now the Dll:Code:Dim rs As ADODB.Recordset Set rs=New ADODB.Recordset 'Get Recordset rs.open "SELECT * FROM Table1",cnn 'Call Dll with rs as parameter: dim obj as Project1.Class1 Set obj=new Project1.Class1 bool = obj.ReceiveRS(rs)
I have references to ADODB on both projects.Code:Public Function ReceiveRS(ByRef RS As ADODB.Recordset) As Boolean On Error GoTo errHandler Do Until RS.EOF 'Do something RS.MoveNext Loop ReceiveRS = True Exit Function errHandler: ReceiveRS = False End Function
How does this look to you? is this what you are trying to do?




Reply With Quote