[AccessD] Create a .lib library for use with Access
John Colby
jwcolby at gmail.com
Sun Mar 26 11:10:50 CDT 2023
Bill, my understanding is that any code in a module is pulled into memory
at the first reference to anything in that module. So ... it is possible
that the mdb / accdb that contains the FE is on the local machine and the
library is somewhere else. So there could be (probably isn't though) a
difference in how long it takes to get at the code in a library. Once that
code is loaded however, all of it is in memory. AFAIK it is more that just
code as well, All memory for constants and global variables are also
assigned / loaded.
On Sat, Mar 25, 2023 at 9:46 PM Bill Benson <bensonforums at gmail.com> wrote:
> Jim- any impact to performance? If the VBA in db2 (db referencing db1’s
> vbproject) were to run its own code instead, which would likely finish
> faster?
>
> I guess I could do an experiment with some loops and UDFs but figured this
> might be something you know OTOH.
> Tia
>
> On Wed, Mar 22, 2023 at 8:20 AM Jim Dettman via AccessD <
> accessd at databaseadvisors.com> wrote:
>
> >
> > FWIW, I prefer to keep a "BaseCode" DB, and just import modules in as
> > needed.
> >
> > Get's rid of all the hassles with using library DB's (having unique
> > function names, worrying about where code is executing, reference, etc).
> > It also let's me control the code better. If I keep one lib DB, using
> > that for every app, if I make a change that will break something, all
> apps
> > that depend on it will break until I can change all of them. With
> > importing, the apps still have the same code until I import the new code
> > from BaseCode, at which point, I can make the adjustments.
> >
> > Only time I'd use an addin/lib DB, is if it was a utility for a wide
> > audience and that's all I was providing.
> >
> > To each their own, but this is what I've found works best overall for
> > shared code for me.
> >
> > Jim.
> >
> > -----Original Message-----
> > From: AccessD On Behalf Of Arthur Fuller
> > Sent: Tuesday, March 21, 2023 7:38 PM
> > To: Access Developers discussion and problem solving <
> > accessd at databaseadvisors.com>
> > Subject: Re: [AccessD] Create a .lib library for use with Access
> >
> > Stuart,
> >
> > Thanks for the link. I read another of his pieces, and learned the
> solution
> > to a completely unrelated issue, as well.
> >
> > On Tue, Mar 21, 2023 at 6:28 PM Stuart McLachlan <stuart at lexacorp.com.pg
> >
> > wrote:
> >
> > > Good article here on how to build and use them:
> > >
> > > https://www.devhut.net/ms-access-library-databases/
> > >
> > > On 21 Mar 2023 at 11:55, Arthur Fuller wrote:
> > >
> > > > Thanks, Jim. That's what I thought, but I couldn't remember the file
> > > > name extension.
> > > >
> > > > On Tue, Mar 21, 2023 at 7:36AM Jim Dettman via AccessD <
> > > > accessd at databaseadvisors.com> wrote:
> > > >
> > > > >
> > > > > A "lib" file in Access with VBA code is put in a .accda or .mda
> > > > > file.
> > > > >
> > > > > It can include any Access object (tables, forms, reports, etc) and
> > > > > have VBA code.
> > > > >
> > > > > You create it with Access and VBA just as you would normally and
> > > > > write VBA code. Once saved, you then use it in other apps by
> > > > > setting a reference to it or using it as an add-in. This is the
> way
> > > > > all the built-in Wizards work in Access. The Zoom box for example
> > > > > that you get when you hit Shift/F2 is in a library database.
> > > > >
> > > > > In regards to a .dll or type lib, you create those in something
> > > > > else, then either write a DECLARE in your code, or set a reference
> > > > > to it in your app, then make calls/use it. But there's no VBA
> > > > > associated with it.
> > > > >
> > > > > HTH,
> > > > > Jim.
> > > > >
> > > > > -----Original Message-----
> > > > > From: AccessD On Behalf Of Arthur Fuller
> > > > > Sent: Tuesday, March 21, 2023 5:29 AM
> > > > > To: Access Developers discussion and problem solving <
> > > > > accessd at databaseadvisors.com>
> > > > > Subject: Re: [AccessD] Create a .lib library for use with Access
> > > > >
> > > > > Ok, I'm wrong. But I thought John Colby has created one, consisting
> > > > > of VBA code. Maybe I misunderstood; it wouldn't be the first time.
> > > > > But I was given to understand that one could collect a bunch of
> > > > > reusable code and package it. Maybe John meant that he references
> > > > > it, although if it's not a .Lib file or a .DLL, then I have no clue
> > > > > as to how one might reference it. It seems a shame to gather all
> > > > > that reusable code and then have to import it into the next app one
> > > > > is going to write. But I guess if that's what's required, ok, I'll
> > > > > do it that way. Creating an Add-In seems totally wrong. (Actually,
> I
> > > > > am creating an Add-In, but it has a form as well as some modules,
> so
> > > > > that's quite another kettle of fish; easy enough to implement,
> > > > > though.
> > > > >
> > > > > On Tue, Mar 21, 2023 at 3:47AM Stuart McLachlan
> > > > > <stuart at lexacorp.com.pg> wrote:
> > > > >
> > > > > > How do you expect to use a .lib file in Access?
> > > > > >
> > > > > > If we are talking about same thing, a .lib is a file which is
> > > > > > statically linked into an application at compile time. (And
> > > > > > that's a realy compile to a .exe file - not what Access does with
> > > > > > VBA code)
> > > > > >
> > > > > > It's essentailly the same as a DLL wrapped inside an executable
> > > > > > file.
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 21 Mar 2023 at 2:35, Arthur Fuller wrote:
> > > > > >
> > > > > > > I'm having lousy luck searching for this. I keep getting hits
> > > > > > > that tell me how to create a library database, not a .lib file.
> > > > > > >
> > > > > > > Suggestions?
> > > > > > >
> > > > > > > --
> > > > > > > Arthur
> > > > > > > --
> > > > > > > AccessD mailing list
> > > > > > > AccessD at databaseadvisors.com
> > > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > > Website: http://www.databaseadvisors.com
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > AccessD mailing list
> > > > > > AccessD at databaseadvisors.com
> > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > Website: http://www.databaseadvisors.com
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Arthur
> > > > > --
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > >
> > > > > --
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > >
> > > >
> > > >
> > > > --
> > > > Arthur
> > > > --
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > Website: http://www.databaseadvisors.com
> > >
> > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> >
> >
> > --
> > Arthur
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
John W. Colby
Colby Consulting
More information about the AccessD
mailing list