B
BnB
This is a two part question regarding Access 2002.
First, I tried setting a reference from one .mdb file to another. The only
thing that was exposed was public code in regular modules, not class modules,
which pretty much negates the value of the reference. Is there something
extra I have to do to expose classes?
Second, I actually plan to do this programmatically. The reason is that
there may be a number of databases with identical "interfaces" but different
data and specific code, and depending on the situation I want to be able to
point to one or the other. So the code will always look the same on the
"master" (referencing) side regardless of which "slave" .mdb is referenced,
the data passing format will be identical, and the details of what goes on in
the slave .mdb will be opaque to the master; it will simply get a result in
the desired fashion.
I can see from the documentation how to change references using VBA, but
there's nothing that says how actually to use that when writing code using
referenced types. In other words, say I can reference either Slave1.mdb or
Slave2.mdb. Assume both have a class MySlaveClass that I want to reference
(assuming I can expose classes per my first question). How do I actually
write code that accesses that class? I can't write "Slave1.MySlaveClass"
because that would only work for Slave1. Do I just write MySlaveClass and
hope it hooks up in real time? I'm assuming there's a fair bit of late
binding here, so I'm trying to minimize the "boundary crossings" between the
master and slave...
It seems like this must be doable (or else there would be no value
whatsoever to being able to programmatically change references), so any
comments on actually how to do it would be appreciated.
Thanks!!
BnB
First, I tried setting a reference from one .mdb file to another. The only
thing that was exposed was public code in regular modules, not class modules,
which pretty much negates the value of the reference. Is there something
extra I have to do to expose classes?
Second, I actually plan to do this programmatically. The reason is that
there may be a number of databases with identical "interfaces" but different
data and specific code, and depending on the situation I want to be able to
point to one or the other. So the code will always look the same on the
"master" (referencing) side regardless of which "slave" .mdb is referenced,
the data passing format will be identical, and the details of what goes on in
the slave .mdb will be opaque to the master; it will simply get a result in
the desired fashion.
I can see from the documentation how to change references using VBA, but
there's nothing that says how actually to use that when writing code using
referenced types. In other words, say I can reference either Slave1.mdb or
Slave2.mdb. Assume both have a class MySlaveClass that I want to reference
(assuming I can expose classes per my first question). How do I actually
write code that accesses that class? I can't write "Slave1.MySlaveClass"
because that would only work for Slave1. Do I just write MySlaveClass and
hope it hooks up in real time? I'm assuming there's a fair bit of late
binding here, so I'm trying to minimize the "boundary crossings" between the
master and slave...
It seems like this must be doable (or else there would be no value
whatsoever to being able to programmatically change references), so any
comments on actually how to do it would be appreciated.
Thanks!!
BnB