Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Developer Toolkits / August 2005

Tip: Looking for answers? Try searching our database.

Auto add a reference library

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Albert - 19 Aug 2005 02:57 GMT
I am writing VBA code using DAO with access 2003
However, my client is using access XP which uses ADO by default. Therefore
they need to add a Microsoft DAO library to their reference and move up that
library in the priority list.
As i have a lot number of clients and they are not familiar with access
environment, how can i auto do the above task by VBA or something else?
(I don't want to re-code my DAO to ADO as DAO is best for getting data from
current DB but ADO is somehow not the right choice)
Douglas J. Steele - 19 Aug 2005 11:49 GMT
The references are part of the MDB. When you give them your application, it
will automatically have whatever references you put there, in the order you
put them.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I am writing VBA code using DAO with access 2003
> However, my client is using access XP which uses ADO by default. Therefore
[quoted text clipped - 6 lines]
> from
> current DB but ADO is somehow not the right choice)
Albert - 19 Aug 2005 16:58 GMT
Thank you for your reply, i have find access has a object to hold the reference
by Using the AddbyFile of AddbyGUID, i can add reference into the list by VB

> The references are part of the MDB. When you give them your application, it
> will automatically have whatever references you put there, in the order you
[quoted text clipped - 10 lines]
> > from
> > current DB but ADO is somehow not the right choice)
Douglas J. Steele - 19 Aug 2005 19:25 GMT
Sure you can. However, you don't need to in the case you described!

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thank you for your reply, i have find access has a object to hold the
> reference
[quoted text clipped - 18 lines]
>> > from
>> > current DB but ADO is somehow not the right choice)
Chris Mills - 22 Aug 2005 03:54 GMT
There may well be ways to manipulate references in code, but IMHO it's not a
good idea. You assume that references you look for will be found, and in any
case your code will need recompiling afterwards.

For mdb. I'm not quite sure what happens if you change references in an mde.

There are only 3 needed references. The less references, then the less the
problem. You will find this philosophy throughout the newsgroups. Things like
ActiveX controls or OLE Automation Libraries, turn out to be just too much
crap.

Get your references sorted and avoid hassles in the first place. For instance,
I almost guarantee you have a reference to "OLE Automation", because it it
installed by MS by default. It is not needed, even for OLE Automation!

You talk about ADO vs DAO, and defaults. Sure ADO may be the default and DAO
may be the normal. SO Remove The Defaults! It's highly unlikely a particular
mdb is using both.

It is not Access Vxx which "uses ADO by default" at all. An mdb does not use
ADO (or DAO) by default. It just happens to implement a default reference,
which is different from actually using it. Remove all unused references, in
this case ADO. That's in your mdb, nothing to do with their Access!

You can auto-install the remaining references (after you have culled them),
because PDW auto-includes the required references. If you minimise references
in your mdb, hassles at a client site are rare. Nothing like you are making it
out to be.

This is as clear as I think I can make it. Like mud :-)

Chris

> I am writing VBA code using DAO with access 2003
> However, my client is using access XP which uses ADO by default. Therefore
[quoted text clipped - 4 lines]
> (I don't want to re-code my DAO to ADO as DAO is best for getting data from
> current DB but ADO is somehow not the right choice)
Paul Overway - 22 Aug 2005 14:34 GMT
You can't change references in an MDE.  So, adding/changing references in
out of the question in that scenario anyway.  But in any case, you're right
to point out that the best practice is to limit any references to the
basics.

Signature

Paul Overway
Logico Solutions, LLC
www.logico-solutions.com

> There may well be ways to manipulate references in code, but IMHO it's not
> a
[quoted text clipped - 52 lines]
>> from
>> current DB but ADO is somehow not the right choice)
Chris Mills - 22 Aug 2005 14:56 GMT
> You can't change references in an MDE.

However, I think I've seen posted that you can now use an mde on a different
version of Access?

In which case, the "Microsoft Access XX Object Library" must change?

I don't really have the facilities to test that, and admit I am guessing a bit
on this.

Chris
Paul Overway - 22 Aug 2005 16:46 GMT
Yes, you can use an MDE with different versions of Access without ill effect
in respect to references.
However, in that scenario, the reference isn't really changing because the
binaries are compatible.  The same usually holds true for other references
that are binary compatible...i.e., an ActiveX component.  However, this is
altogether different from dropping/adding a reference in an MDE, which
cannot be done whether the references are binary compatible or not.  The MDE
is compiled with the reference and an MDE by its very nature cannot become
decompiled.  This is no different than setting a reference in a VB project
and then expecting the EXE to add or drop a reference during runtime.

Signature

Paul Overway
Logico Solutions, LLC
www.logico-solutions.com

>> You can't change references in an MDE.
>
[quoted text clipped - 9 lines]
>
> Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.