Can a database expose a class?

  • Thread starter Thread starter Francesc Hervada-Sala
  • Start date Start date
F

Francesc Hervada-Sala

Hello NG,

I have developed a class module with Access 2000, say myClass. Is it
possible for my database to expose myClass, so that other databases can
use it?

For example I would like to use Dim a As New myClass at other databases
(without copying the class source code into these databases).

In other words, I would like to use myClass like any other public
available class (such as DAO).

Thank you,

Francesc
 
In the other database(s), add a reference (via Tools, References) to the MDB
(or MDE) file that contains the class you want to use.
 
There was a workaround to expose classes (do a google
search of the Access newsgroups to try to find more
information), but it is less useful than you might think,
because the class still runs in the context of the library
database - that it, it doesn't see any of the tables and
data of the calling code.

You can of course pass an instance of the current
Application to each object as you instantiate it, but I've
never seen an example of anyone who thought it was
worth the trouble.

(david)
 
Back
Top