[AccessD] Library Database? .mda or .mdb as referenced librar y-pros or cons?

Heenan, Lambert Lambert.Heenan at AIG.com
Tue Dec 14 12:45:07 CST 2004


Ok. I've done some testing in both Access 97 and Access 2002.

1/ Created an MDB file with a single module. The module has a single
function that returns as string. The string consists of the value of
CurrentDb.Name, a new line and the value of CodeDb.Name

2/ Compiled the MDB file to an MDE file.

3/ Create another MDB file, and set a reference in it to the MDE file
created in step 2. 
Added a module to the second MDB with a function ("WhatGives()") which calls
the function in the library MDE and displays the returned string in a
MsgBox. 
Call the function WhatGives() from the autoexec macro.

4/ Compile the second MDB to an MDE file. Then I open the second MDE,
autoexec runs and I see the correct CurrentDb and CodeDb information
displayed, as expected.

5/ Open the first, 'library' MDB and added another function to the existing
module. Then compile it to an MDE once more.

6/ Open the second MDE again. This time Access displays the message "The
expression you entered has a function that Microsoft Access can't find."

7 Open the second MDB file and AutoExec runs without complaint, and I see
the two file paths displayed. Recompile the second MDB to an MDE again, and
now I can open the MDE and it runs the library function just fine.

This behavior is repeated exactly when using Access 2002 (on a different
computer than the one with Access 97).  So it seems like MDB applications
will happily update themselves when they are using a reference to a changed
MDE library, but MDE applications will not. This gels with the notion that
MDA files do on exhibit this problem as they contain the VBA source code (do
they really?).  I'm assuming that the very simple setup I created was robust
enough to display an error message, but in a more complex, "real world"
example with a large library file and similarly large client application I
get Dr. Watson errors when I try running an application which is referencing
a library that got changed (if the client is not first recompiled).

FWIW 

Lambert

> -----Original Message-----
> From:	Heenan, Lambert 
> Sent:	Tuesday, December 14, 2004 12:13 PM
> To:	'Access Developers discussion and problem solving'
> Subject:	RE: [AccessD] Library Database? .mda or .mdb as referenced
> library-pros or cons?
> 
> Interesting. I'm going to go off and do some more testing. I thought I'd
> put this problem to bed years ago as 'just one of those things you have to
> deal with', but now I'm wondering.
> 
> I'm talking about plain vanilla code routines stored in an MDE file which
> is then added as a reference in another application, which in turn is
> compiled to an MDE file. This is in an Access 97 environment, but I think
> it also happens with Access 2002 - something else to test.
> 
> Lambert
> 
> 	-----Original Message-----
> 	From:	accessd-bounces at databaseadvisors.com
> [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of William Hindman
> 	Sent:	Monday, December 13, 2004 8:32 PM
> 	To:	Access Developers discussion and problem solving
> 	Subject:	Re: [AccessD] Library Database? .mda or .mdb as
> referenced library-pros or cons?
> 
> 	..not specifically but I do note that when I install updates to 3rd
> party 
> 	libraries I use, I don't recall ever having to recompile the apps 
> 	referencing them.
> 
> 	William Hindman
> 
> 	----- Original Message ----- 
> 	From: "Heenan, Lambert" <Lambert.Heenan at aig.com>
> 	To: "'Access Developers discussion and problem solving'" 
> 	<accessd at databaseadvisors.com>; "'John W. Colby'" 
> 	<jwcolby at colbyconsulting.com>
> 	Sent: Monday, December 13, 2004 5:06 PM
> 	Subject: RE: [AccessD] Library Database? .mda or .mdb as referenced 
> 	library-pros or cons?
> 
> 
> 	> Thus far I've not had to create any MDA's, but I see little reason
> to 
> 	> think
> 	> that this same problem would not also show up with them. After all
> it all
> 	> boils down to the entry point of functions/subs getting changes
> when the
> 	> library is modified. Why would that not happen with an MDA?  Have
> you done
> 	> an empirical test?
> 	>
> 	> Lambert
> 	>
> 	>> -----Original Message-----
> 	>> From: accessd-bounces at databaseadvisors.com
> 	>> [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of John W.
> Colby
> 	>> Sent: Monday, December 13, 2004 4:07 PM
> 	>> To: 'Access Developers discussion and problem solving'
> 	>> Subject: RE: [AccessD] Library Database? .mda or .mdb as
> referenced
> 	>> library-pros or cons?
> 	>>
> 	>> That might be true for an MDE but I don't think that is true for
> an MDA.
> 	>>
> 	>> John W. Colby
> 	>> www.ColbyConsulting.com
> 	>>
> 	>> Contribute your unused CPU cycles to a good cause:
> 	>> http://folding.stanford.edu/
> 	>>
> 	>> -----Original Message-----
> 	>> From: accessd-bounces at databaseadvisors.com
> 	>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> Heenan, 
> 	>> Lambert
> 	>> Sent: Monday, December 13, 2004 3:38 PM
> 	>> To: 'Access Developers discussion and problem solving'; 'Dan
> Waters'
> 	>> Subject: RE: [AccessD] Library Database? .mda or .mdb as
> referenced
> 	>> library-pros or cons?
> 	>>
> 	>>
> 	>> Just a little heads-up regarding using 'library' files.
> 	>>
> 	>> If you make a change to the library (such as you add a new handy
> dandy
> 	>> routine to it, or make some alteration to an existing routine)
> then any
> 	>> and
> 	>> all the applications which are using the library will need to be
> 	>> recompiled.
> 	>> Otherwise you will get a Dr. Watson error when you try to run an
> 	>> application
> 	>> that has a reference to the (now changed) library.
> 	>>
> 	>> Lambert
> 	>>
> 	>> > -----Original Message-----
> 	>> > From: accessd-bounces at databaseadvisors.com
> 	>> > [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of Dan
> Waters
> 	>> > Sent: Monday, December 13, 2004 11:35 AM
> 	>> > To: 'Access Developers discussion and problem solving'
> 	>> > Subject: RE: [AccessD] Library Database? .mda or .mdb as
> referenced
> 	>> > library-pros or cons?
> 	>> >
> 	>> > Thanks Charlotte!
> 	>> >
> 	>> > I don't need an add-in, just a library, so I'll just use an mdb
> or
> 	>> > mde.
> 	>> >
> 	>> > Dan Waters
> 	>> > ProMation Systems
> 	>> >
> 	>> > -----Original Message-----
> 	>> > From: accessd-bounces at databaseadvisors.com
> 	>> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> Charlotte
> 	>> > Foust
> 	>> > Sent: Monday, December 13, 2004 10:02 AM
> 	>> > To: Access Developers discussion and problem solving
> 	>> > Subject: RE: [AccessD] Library Database? .mda or .mdb as
> referenced
> 	>> > library-pros or cons?
> 	>> >
> 	>> > MDA normally designates an add-in library.  To function as an
> add-in,
> 	>> > there is a specific table required.  To function as a library,
> not.
> 	>> > We compile several mdbs into mdes and reference them as
> libraries,
> 	>> > including the one with all our Redemption code in it.
> 	>> >
> 	>> > Charlotte Foust
> 	>> >
> 	>> >
> 	>> > -----Original Message-----
> 	>> > From: Dan Waters [mailto:dwaters at usinternet.com]
> 	>> > Sent: Sunday, December 12, 2004 3:03 PM
> 	>> > To: 'Access Developers discussion and problem solving'
> 	>> > Subject: RE: [AccessD] Library Database? .mda or .mdb as
> referenced
> 	>> > library -pros or cons?
> 	>> >
> 	>> >
> 	>> > Jim,
> 	>> >
> 	>> > After setting a reference to DAO 3.6, and resolving circularity
> among
> 	>> > function and procedure calls, everything seemed to work
> correctly.
> 	>> >
> 	>> > I did set a reference to the Library mda.  It appears that
> doing this
> 	>> > allows the code in the library database to work exactly as if
> the code
> 	>> > existed in the FE mdb.  I did not get an initial error the
> first time
> 	>> > the library code was used.
> 	>> >
> 	>> > I also tried changing the mda to an mdb.  Everything still
> worked just
> 	>> > as before.  So now I'm wondering what the difference is between
> an mda
> 	>> > and an mdb?  Any pros/cons to one or the other when using as a
> library
> 	>> > database?
> 	>> >
> 	>> > Dan
> 	>> >
> 	>> > -----Original Message-----
> 	>> > From: accessd-bounces at databaseadvisors.com
> 	>> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim
> 	>> > Lawrence
> 	>> > (AccessD)
> 	>> > Sent: Sunday, December 12, 2004 3:56 PM
> 	>> > To: Access Developers discussion and problem solving
> 	>> > Subject: RE: [AccessD] Library Database?
> 	>> >
> 	>> > Hi Dan:
> 	>> >
> 	>> > Not the way you trying to do it. You can create a new MDB/MDE,
> with a
> 	>> > module and in that module, a group of public variables,
> function and
> 	>> > subroutines. This will be your library. The MDB/MDE database
> will have
> 	>> > to be attached to your caller/main MDB before the functionality
> can be
> 	>> > accessed. (file/get external data/link...) Just like classes
> only
> 	>> > public object, in the module can be accessed externally. Note;
> that
> 	>> > none of the modules objects can be accessed until the module is
> 	>> > formally called
> 	>> > (Example: if your library module is initially called from a
> Form open
> 	>> > event, you will receive an error but the Form's load event
> works fine.)
> 	>> > and from then on all the functions /subroutines /variables will
> be
> 	>> > exposed because the whole module is then automatically loaded
> into
> 	>> > memory.
> 	>> >
> 	>> > HTH
> 	>> > Jim
> 	>> >
> 	>> > -----Original Message-----
> 	>> > From: accessd-bounces at databaseadvisors.com
> 	>> > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Dan
> Waters
> 	>> > Sent: Sunday, December 12, 2004 1:27 PM
> 	>> > To: Database Advisors
> 	>> > Subject: [AccessD] Library Database?
> 	>> >
> 	>> >
> 	>> > I would like to create a separate file (library?) to contain
> many
> 	>> > procedures and functions which are used by all my customers.
> 	>> >
> 	>> >
> 	>> >
> 	>> > However, most of these either read or write information to the
> BE
> 	>> > using recordsets.  I tried to set up a library database (.mda),
> but
> 	>> > this errored out when I tried to dim a recordset variable.  The
> .mda
> 	>> > file appears to not recognized the DAO prefix.
> 	>> >
> 	>> >
> 	>> >
> 	>> >             dim rst as DAO.Recordset
> 	>> >
> 	>> >
> 	>> >
> 	>> > Is there a way to create a database file to contain procedures
> and
> 	>> > functions, called from the FE mdb, that can be used read/write
> to
> 	>> > tables in the BE mdb?
> 	>> >
> 	>> >
> 	>> >
> 	>> > Thanks!
> 	>> >
> 	>> > Dan Waters
> 	>> >
> 	>> > --
> 	>> > AccessD mailing list
> 	>> > AccessD at databaseadvisors.com
> 	>> > http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> > Website: http://www.databaseadvisors.com
> 	>> >
> 	>> > --
> 	>> > AccessD mailing list
> 	>> > AccessD at databaseadvisors.com
> 	>> > http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> > Website: http://www.databaseadvisors.com
> 	>> >
> 	>> > --
> 	>> > AccessD mailing list
> 	>> > AccessD at databaseadvisors.com
> 	>> > http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> > Website: http://www.databaseadvisors.com
> 	>> > -- 
> 	>> > AccessD mailing list
> 	>> > AccessD at databaseadvisors.com
> 	>> > http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> > Website: http://www.databaseadvisors.com
> 	>> >
> 	>> > --
> 	>> > AccessD mailing list
> 	>> > AccessD at databaseadvisors.com
> 	>> > http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> > Website: http://www.databaseadvisors.com
> 	>> -- 
> 	>> AccessD mailing list
> 	>> AccessD at databaseadvisors.com
> 	>> http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> Website: http://www.databaseadvisors.com
> 	>>
> 	>>
> 	>>
> 	>> -- 
> 	>> AccessD mailing list
> 	>> AccessD at databaseadvisors.com
> 	>> http://databaseadvisors.com/mailman/listinfo/accessd
> 	>> Website: http://www.databaseadvisors.com
> 	> -- 
> 	> AccessD mailing list
> 	> AccessD at databaseadvisors.com
> 	> http://databaseadvisors.com/mailman/listinfo/accessd
> 	> Website: http://www.databaseadvisors.com
> 	> 
> 	-- 
> 	AccessD mailing list
> 	AccessD at databaseadvisors.com
> 	http://databaseadvisors.com/mailman/listinfo/accessd
> 	Website: http://www.databaseadvisors.com



More information about the AccessD mailing list