Function Library mda

G

Guest

I'm working through "Building Applications with Microsoft Access 97", and I
got excited about the notion of library databases. I have a bunch of Access
applications, and I'm always importing a set of code modules into each, to
ensure that I have the correct version.

This morning I've attempted to create a function library, but now I cannot
see my functions in the expression builder under query design. Is this
behavior expected?
I can see in VBA view the modules in the project that refers to the library
(This implies that I have established the reference).

If not being able to use my functions in queries is the price of using a
library mda, then I'm not sure its worth the effort.

Thank you in advance for your insights.
George
 
A

Alex Dybenko

Hi George,
i once tried the same, with same result, so i think this is a limitation of
access. but idea of library db is good, if you plan to use only few
functions in queries - you can write a "wrapper" functions in native module.
for VBA code - library functions and classes should work fine
 
G

Guest

I also cannot see my functions in RunCode: Function Name expression builder.
I was imagining that perhaps a Public statement would be required, or
something like that.

It seems inconceivable that the solution is to build wrapper functions for
all the functions I've built and moved to library. Then, I would have two
functions instead of one to maintain (though admittedly the wrappers are
trivial).

Is this behavior expected? Or, more likely, am I doing something wrong?

Thanks again for any help.

George
 
P

Paul Overway

I make extensive use of libraries. Your discovery in respect to functions
not showing up in Expression builder is correct, but isn't really all that
big of an issue. The things you need to watch out for...

1. If you change anything in the library, you must recompile all databases
that have a reference to it. So, your library should be fairly stable in
respect to the functions it contains.
2. Classes require a small modification in order to be available in your
databases. See

http://www.mvps.org/access/modules/mdl0034.htm

3. If you need to use a library function in a query, you'll need to create
a wrapper function in your database for the library function.
 
G

Guest

Hmmm. I also got quite excited when I found out about library databases a
little while back, but have also been frustrated by similar issues to
George...

I too found that everything that isn't a global function in a standard
module is unavailable in the referencing database, and although I did come
accross the class module workaround
(http://www.mvps.org/access/modules/mdl0034.htm), I've had no such luck with
gaining access to any other objects in the library (forms, macros, etc.) I'm
about to start another thread, specific to my library forms problem, but I'd
be curious to hear comments about exactly why Microsoft saw fit to correct
the 'annomaly' of publicly available resources in library databases (see
http://support.microsoft.com/kb/160011/en-us for details)!! Afterall, what's
the use of a library that no one can use?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top