Discussion Locked

Invalid Use of Property

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
When I try to compile my project to a dll, a function of datatype Recordset produces an "Invalid use of property" error. Is it not possible to pass recordsets through funcions in a COM DLL?

3 replies

by medievaldude

It is possible to pass recordsets through functions in a COM DLL. Suppose you had a function such as:
Function myfunction (...) AS ADODB.Recordset
...
End Function

You could call this function from a standard exe that has a reference to the DLL by simply doing something like:
Dim rs As ADODB.Recordset
Dim ClassInstance As Myproject.Myclass
Set ClassInstance = New Myclass
Set rs = ClassInstance.myfunction

Make sure you use Set since you're dealing with recordsets. That's the basics of how to do it, though. Let me know if you have any more questions about this.

This discussion is closed to new replies.