[AccessD] Create a .lib library for use with Access

Arthur Fuller fuller.artful at gmail.com
Wed Mar 22 10:00:47 CDT 2023


I can see your points, Jim. That in fact is why I'm doing an Add-In, for a
certain group of tasks that (could) apply to any Access app, the larger the
better. I can also see your point about 1 library vs. several. I personally
don't go for the Import route, but you've made me see the down-side to
making one big library; I've modified my strategy there to break up the one
library into several, each containing a group of functions such that if you
need one, chances are good you'll need several. For example, I have one
group of date/time functions that extend the built-ins: LBDoM() returns the
last business day of the month, third Monday of the month and so on (that
one takes parameters so you're not committed either to "third" or
"Monday"). In Canada, certain government payouts arrive on dates calculated
in that fashion: Old Age Supplement and Canada Pension Plan, for example,
arrive on the third last business day of the month.


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
>


-- 
Arthur


More information about the AccessD mailing list