I have a dll with two properties, a Set and Get:
Property Get objConn() As ADODB.Connection
Set objConn = m_objConn
Property Set objConn(objNewValue As ADODB.Connection)
Set m_objConn = objNewValue
I have a test exe, which creates this connection object (successfully) and then sets the property in the dll to this object, which also works.
But when I try and set the connection:
Dim objCommand As ADODB.Command
Set objCommand = New ADODB.Command
Set objCommand.ActiveConnection = m_objConn ' error here
I get an error (even though the m_objConn appears to contain the right connection string?):
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
Has anyone come across this problem before?
Thanks in advance.