Pat Hartman(MVP) wrote in message
<O69KshQ$FHA.3804@TK2MSFTNGP14.phx.gbl> :
> I think that class modules are only available when the object to which they
> belong is open.
[quoted text clipped - 25 lines]
>>
>> Can
I don't see the original question on my server, but hope this
will find it's way to their server ...
I think one should be able to do this through:
In the referenced database, set the instancing property of the
class(es) to 2-PublicNotCreateable.
Still in the referenced database, insert a standard module.
Within that standard module, you create some code instantiating
the class
Public Property Get GetMyClass() as Object
Set GetMyClass = New DataAccess
End Property
Note the declaration of the return object (object, not
classname)
Then in the database where you need this class, you should be
able to instantiate through something like this:
Dim myClassObject as DataAccess
Set myClassObject = GetMyClass
Then you should be able to use it's properties and methods ...

Signature
Roy-Vidar
Can - 12 Dec 2005 16:18 GMT
The reference worked great but I have another problem.
Public Function GetXMLfromCommandText( _
ConnectionString As String, _
CommandText As String) As Stream
but I get the error
"user-defined type not defined"
I think it is a reference issue but I am not certain.
I have the following references (in order of priority)
- Visual Basic for Applications
- Microsoft Access 9.0 Object Library
- OLE Automation
- Microsoft ActiveX Data Objects 2.1 Library
- Microsoft ADO Ext 2.7 for DDL and Security
- Microsoft DAO 3.6 Object Library
- Microsoft XML, v5.0
> Pat Hartman(MVP) wrote in message
> <O69KshQ$FHA.3804@TK2MSFTNGP14.phx.gbl> :
[quoted text clipped - 56 lines]
>
> Then you should be able to use it's properties and methods ...
RoyVidar - 12 Dec 2005 17:35 GMT
Can wrote in message
<ADB29FF0-2F4B-4FA0-BC6B-700BCC7E36FE@microsoft.com> :
This is outside my little area of expertice (should I have one;-)),
but I think you'll need a newer/higher version of ADO for this,
not that I know which, but I find it in 2.5 and higher.
I'm a bit picky about explicit declarations, too;-)
... as adodb.stream
> The reference worked great but I have another problem.
>
[quoted text clipped - 76 lines]
>>
>> Then you should be able to use it's properties and methods ...

Signature
Roy-Vidar
Can - 13 Dec 2005 18:56 GMT
Worked like a charm.
> Can wrote in message
> <ADB29FF0-2F4B-4FA0-BC6B-700BCC7E36FE@microsoft.com> :
[quoted text clipped - 87 lines]
> >>
> >> Then you should be able to use it's properties and methods ...
Can - 14 Dec 2005 19:37 GMT
Okay so it didn't quiet work like a charm. I am able to set
Set da = GetDataAccess
But when I try and use a function within that class module
fOK = da.CheckConnection(mstrOLEDBConnect)
I get error 424: Object Required
What am I doing wrong?
Here's the declaration of the function from the class module
Public Function CheckConnection(ConnectionString As String) As Boolean
> Can wrote in message
> <ADB29FF0-2F4B-4FA0-BC6B-700BCC7E36FE@microsoft.com> :
[quoted text clipped - 87 lines]
> >>
> >> Then you should be able to use it's properties and methods ...
RoyVidar - 14 Dec 2005 20:09 GMT
Can wrote in message
<4B6FC5B2-1A37-46BB-A8AD-EED8B6B812E9@microsoft.com> :
Sorry, I don't know. Could it be something wihin the function? I mean,
would it return something if you just assigned True?
> Okay so it didn't quiet work like a charm. I am able to set
>
[quoted text clipped - 9 lines]
> Here's the declaration of the function from the class module
> Public Function CheckConnection(ConnectionString As String) As Boolean

Signature
Roy-Vidar
Can - 19 Dec 2005 19:22 GMT
Function is fine. I tried just assigning true and it gave me the same
error. Any other ideas?
> Can wrote in message
> <4B6FC5B2-1A37-46BB-A8AD-EED8B6B812E9@microsoft.com> :
[quoted text clipped - 15 lines]
> > Here's the declaration of the function from the class module
> > Public Function CheckConnection(ConnectionString As String) As Boolean