VBA Reference Library Links

Hello,

I have a MS Access application that contains a library reference to the following link: C:\Windows\System32\Macromed\Flash\Flash10m.ocx

I have two questions about this link, and others of it's type.

1) When users update their flash player to a newer version, and the file names change to reflect the new versions, will this reference automatically update so as to avoid a broken link?

2) I asume 64 bit windows will have .dll and .ocx files installed in the system64 folder... correct? And, if so, how will this effect the operation of my application on 64 bit systems? Will I have to create new library file links for 64 bit users? Or, will the references update to reflect the operating system?

Thank you!
BillMoodyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
1)
"will this reference automatically update so as to avoid a broken link?"
I don't think so.  If you are talking about a VBA Reference, they only time they would (in theory) get automatically update is if say you upgraded/converted an Access 2003 to say Access 2010.  The basic core references usually get updated.

The reference you listed is a special Reference, so I don't see any way it would be automatically updated.

2) Not sure I follow and/or I don't know. But ... I can say that I have Office/Access 2010 (32 bit) running on a Win 7 x64 machine with no issues (at least at this time).

mx
0
JezWaltersCommented:
If you use late binding, your Access database will always create objects using the latest versions.

To do this, remove the Flash library References, declare your variables "As Object" and use CreateObject to instantiate them.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JezWaltersCommented:
I mean, like this:
Dim fshFlash As Object  ' Actually ShockwaveFlashObjects.ShockwaveFlash

Set fshFlash = CreateObject("ShockwaveFlash.ShockwaveFlash")

Open in new window

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
<When users update their flash player to a newer version, and the file names change to reflect the new versions, will this reference automatically update so as to avoid a broken link?>

That would depend entirely on how the reference library is updated, and that is out of your hands. In almost every case, if the issuer/manufacturer maintains binary compatibility your link would remain intact. If they break it, your link will break, and you'll have to re-deploy your application.

However, if you want to be as safe as possible from future issues, use JezWalter's advice re: Late Binding. Note that most people use Early Binding during development, since they have the benefit of Intellisense, and then switch to Late Binding just before deployment.

< I asume 64 bit windows will have .dll and .ocx files installed in the system64 folder... correct? And, if so, how will this effect the operation of my application on 64 bit systems? Will I have to create new library file links for 64 bit users? Or, will the references update to reflect the operating system?>

VBA References are resolved based on several factors, and the physical location of the files (the .ocx/.dll etc files) often does not play a role in that. References are resolved by first determining if  the reference is already loaded in memory. If not, then VBA determines if the RefLibPath registry key exists. This is a regsitry entry that is built by the creator of the library. These entries are typically generated when the reference files are initially installed.

In almost all cases, one of the first two methods will work for your references (assuming, of course, that the reference is available on the machine). If both of those methods fail to locate the reference, then then Access will search for the reference in these areas:

Application Directory      Location of Msaccess.exe.

Current Directory      Directory that you see if you click Open on the File menu.

System Directory      The System folder and the System32 folder that are located in the Windows folder or in the WINNT folder.

WinDir      The folder where the operating system files run. This is typically the Windows folder or the WINNT folder.

PATH Environment Variable      This system variable contains a list of folders that are directly accessible by the system.

File Directory      The folder that contains the .mdb file, the .mde file, the .adp file, or the .ade file, and any subfolders.

From here: http://support.microsoft.com/kb/824255


0
BillMoodyAuthor Commented:

Late binding seems to be the perfect solution for this and other library reference issues that have been problematic with some installs.

In Jez's example above, there is nothing in the code to create the object but a description of the object ... CreateObject("ShockwaveFlash.ShockwaveFlash"). Is that all that is required? And, if so, how do you determine the correct syntax for identifying an object that you wish to bind? Are they contained in and among the system folders referenced above? I have others I would like to late bind as well.

Thanks for the great info.
0
JezWaltersCommented:
If you don't Reference the Flash library, then you can't use the "New" keyword to create the object - you have to use the CreateObject() method instead.

The best thing to do is to use early binding while you're developing the code (so errors can be trapped at compile time and IntelliSense works), and then switch to late binding when everthing's working.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Keep in mind that late binding can result in a performance hit, as the Reference has to be resolved at that time.

Also, for this specific example:
C:\Windows\System32\Macromed\Flash\Flash10m.ocx

What is the Late binding code/syntax ?

mx
0
BillMoodyAuthor Commented:
Jez,

This is ubdoubtedly a silly question, but using CreateObject, how do you determine the proper name with which to reference the appropriate library. You used "ShockwaveFlash" in your example. How did you determine that was the correct name for the shockwave reference? Like I mentioned, I have other references I would like to late bind as well, and I am unsure how to identify them in the CreateObject syntax.

Thanks.
0
JezWaltersCommented:
I've always just done a Google search like "Shockwave CreateObject VBA" and then looked through the links.  In this case I used this link:

http://www.eggheadcafe.com/searchform.aspx?search=ShockwaveFlash
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
But how is that related to Flash10m.ocx ?

mx
0
JezWaltersCommented:
If you look in the body of the link I mentioned above, you'll see the required CreateObject() invocation.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
No, I'm asking how to specifically reference Flash10m.ocx or equivalent ?

And there are tons of links on that page.

mx
0
BillMoodyAuthor Commented:

That is my question too MX.

I see late binding as a promising tool, and I have other links such as ExpCtrls.dll and MSOUTL.OLB that would also be good candidates, as I include them with my install but still suffer from broken links on some installations. How would I determine how to reference those libraries and any others I may want to late bind in the future?

Thanks...
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You just have to do some research into the various libraries in order to determine exactly how to reference them. In most cases, you'll find information about stuff like this at the manufacturer's website.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
I guess what I'm saying is that ... I'm not 100% convinced ... in this specific case, that ... Late Binding will solve the problem ...?

mx
0
JezWaltersCommented:
How about this link then

http://www.vbforums.com/showthread.php?t=559841

You need to drop the trailing ".10" to be version independent.
0
JezWaltersCommented:
You can get this information from the registry too - take a look at HKEY_CLASSES_ROOT\.swf
0
JezWaltersCommented:
If you look for "C:\Windows\system32\Macromed\Flash\Flash10o.ocx", you'll find the version independent program id at HKEY_CLASSES_ROOT\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\VersionIndependendProgID
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
<I guess what I'm saying is that ... I'm not 100% convinced ... in this specific case, that ... Late Binding will solve the problem ...?>

You might be right, since we're dealing with an embedded control (i.e. the Flash player). Assuming they maintain binary compability between versions of the .ocx file, however, the reference shouldn't be broken if Flash updates the player. VBA would pick up that reference (using one of the methods detailed earlier) and would continue happily along.

If we're dealing with something that is not a "physical" item on a form (like an ADO Recordset, for example) then Late Binding would work.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
"You might be right, "
Well, not saying I am either.  Just would like to see the OP test this ...

mx
0
BillMoodyAuthor Commented:
Thank you all for your input. Late binding looks like a good solution. I'll give it a shot.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Were you able to test this?

mx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.