Shared Code

  • Thread starter Thread starter Dave Ruhl
  • Start date Start date
D

Dave Ruhl

I am creating a new application and want to use many of
the functions I have created in modules of another
application. Is there a way I can store these modules so
they can be accessed by multiple apps ? If I modify a
function, or add a new one, I don't want to have to go to
every app to apply the change.
 
You can move out the code into a mdb, then convert that library of your code
to a mde.

Then, while in the code editor you can go tools->references and set a
reference to that .mde. It will thus become a shared "library" of code.

It is a good way to share your common library code.

However, if you spent any amount of time in this newsgroup..you will note
that broken references is one of the most common questions here. In other
words, if you move your application to another pc, then that reference must
be set..and this is thus a point in your system that can break.

As a result, I do tend to build up a "library" mdb..but I just *import* the
code into whatever new application I am working on. So, for example I have a
bunch of code for managing security in my application. I thus have a code
module called "security". I have another module for word merge. So, I kind
of pick out what I need and import it into the current application. I do
this, since then I can send out a new front end to a client..and NOT have to
worry about updating that library code for all my users.

So, while having a library that you can use to "share" your code is nice,
...it does complicate the updating of your users, as now you often have to
send out TWO updates, one for the front end, and one for the library code
(both of which are on each pc).

And, I want to be able to send out updates to my customers via email
etc....and if you have a library of code (and the needed ref), then any
moving of the dir, or if a user does NOT place the resulting library code in
the correct directory..you software will not work.

So, for me...using the libary code approach is a real support
nightmare......and thus I just organize my libary of code in a nice way..and
then using standard import anytime I need some code to do somthing.
 
Thanks Albert, as always you provided a very helpful and
informative answer!

One more question though, what is an MDA file ? I think
I've seen it referred to as a library.
 
Dave Ruhl said:
Thanks Albert, as always you provided a very helpful and
informative answer!

You are most welcome.

Yes...and I certainly can agree with your question about making a library
file. I wish we had what is called a linker!

However, you can use that mde library idea. Some do find the benefits
outweigh the problems I mentioned. My guess is that you are writing more
code...and as you write more code..then having a nice re-useable library of
code for all the applications is really very nice (so, your question is/was
a good one). Hence, you *can* do this library idea in ms-access, but it
certainly is not near as good as something like c++, or even VB+ in this
regards. Of course, while I mentioned the references problems their is some
benefits also. If you have 10 applications that use the library code..then
you can update all ten applications by updating JUST the one library.

I avoided the library approach MOSTLY due to not wanting to increase any
customer support problems. Thus, I might have a bit of extra work to update
and maintain my code...but at least my customer don't see this, nor have any
increased support troubles. It makes the problems mine..and not my
customers.

One more question though, what is an MDA file ? I think
I've seen it referred to as a library.

Hum...if my memory serves me correct...I think mda was the same as a .mdw
security file.

You might find it interesting that a mdw security file for ms-access is in
fact a standard access database..and can be opened by ms-access.

So, pretty sure that mda was simply an earlier version of a mdw file.
However, both of these security file types are standard ms-access database
files...and can be opened
 
Thanks again! I tried the linked MDE solution and it
works great. We only have 4 apps that use this shared
code, but I'm anticipating more, so this will help a
lot. Take care...
 
Back
Top