I set up a Virtual PC (VPC) using XP 2005 as the OS. With no programs
installed in this VPC, I checked for the presence of all my original
references. Five of my original references were present: STDOLE2.TLB,
MSADO21.TLB, SCRRUN.DLL, MSADOX.DLL, and COMPATUI.DLL. There were 29
files starting with OLE..... and 5 like MSADO??.TLB where ?? = 20, 21,
25, 26, and 27.
The conclusions I draw from this, and many of you also referred to
these, are: 1. Even though Access may automatically check a reference as
needed, it may already be on the PC and not need to be checked if Access
References looks for it;
I'm not sure you still understand what you are seeing in that references
dialog. The total list of unchecked references is coming from Windows.
Neither Access nor your particular file care one whit about unchecked
references.
The list of checked references is stored within each Access file. Some
are checked by default in new files and some get added later due to
developer actions. There are no default references that should ever be
missing because installing Access should install those libraries.
So all of the following are possible...
A checked reference that is not missing and is needed
A checked reference that is not missing and not needed
A checked reference that is missing and not needed (error)
An unchecked reference that is not missing and is needed (error)
An unchecked reference that is not missing and not needed
(this last is the vast majority of the list)
2.The previous suggestion of unchecking a reference and seeing if Access
wil compile, is a very worthwhile suggestion.
Yes, that generally is how you prove it is not needed. A "needed"
reference that is not checked will cause a compile error.
3. Two fellows previously
discussed deleting an OLE reference without any negative results. This
very likely may have been because it already existed with the OS
installation.
Irrelevant. LOTS of libraries exist on the OS installation. The reason
the reference can be removed is because the VBA project is not making any
calls to it (with early binding).
Related to this, what locations does the reference routine search?
\System? and/or \System32? and/or where? Some of the references were
deep into 'c:\Program Files\common files\system\ado'. Would references
normally look there if a reference was needed but was unchecked. Anyone
know?
This is provided by Windows. When you open a file by double-clicking
what chose the program to use? Windows. That list is the list of all
registered COM libraries being reported by Windows. It does not matter
where they are located as long as Windows knows where they are located.
That is what "registering" a library does. It tells Windows "here is
this library and where it is located. Please use this library any time
Some_COM_Object is instantiated in a program".
Another unknown is that the above is true for Windows 2005 plus any SP?
installed. One can never be sure a users PC is of the same version and
hence may not have these files.
That is precisely why it is not recommended that developers use them for
distributed applications. You can only be certain that the Access default
libraries will be present. Anything else is a crap shoot unless your
installation program is installing them.
Is the only safe installation, related to references, to have the
install program check for a reference and, if not found, install it if
it can legally be installed. WOW! Is this being overblown and
unnecessarily complicated?
It's very simple really. Don't use non-default references unless you are
in a controlled environment (company where all PC software is consistent)
or where your program is installing them.
Your install program does not have to "check for a reference".
Installation programs are automatically smart enough to only install a
library that does not already exist on the target PC. Of course it might
replace an existing library with yours if yours is newer. This could
potentially cause existing software on the PC to start malfunctioning.
Yet another reason to avoid non-default libraries.
I respectfully must say that after 30 posts in this thread, I still do
not have a clear, definitive way of knowing whether a particular file
can or cannot be downloaded onto a user's PC. The one specific file I
asked for a YES or NO was answered with 'Probably not needed'.
This is answered by how you acquired it. If you downloaded it or
purchased it then you should have been explicitly informed as to whether
you are allowed to distribute it. The fact that it is installed on your
PC certainly does not mean that any more than you are allowed to give
your copy of Word to 50 of your friends and co-workers.
I close with a proven saying that is all too often violated. "In a
technical enviornment, the ultimate degree of sophistication is
SIMPLICITY."
And the simplest way to deal with non-default COM libraries is to not use
them. The next simplest is to use them with late binding so that you do
not create a reference dependency. The least simple way is to add them
as references and use them with early binding.