Avatar of kenabbott
kenabbottFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

MS Access references

Hi

I have an Access db which is installed on a number of PC's in an office.  It requires reasonably frequent updates but I am having a problem with the references.  For example on my PC I have to have it set to Outlook 14.0 Object Library. However on some (but not all) of the PC's where it is installed it only works with Outlook 12.0 Object Library.  I have also noticed that one of the PC's that does have Outlook 14.0 Object Library seems to have it installed in a different place.

At present the references are having to be reset manually every time there is an update but is there a more automated way of resolving this?

Man thanks
Microsoft Access

Avatar of undefined
Last Comment
Scott McDaniel (EE MVE )
Avatar of smilitaru
smilitaru
Flag of Romania image

Depending on how complex it is the Access-Outlook interacion, you coul use late-binding for creating Outlook objects.
So when you declare the Outlook objects, you'll obly have to declare As Object and when you create the instance you can use CreateObject using the object ProgID.
This way you could remove the Outlook reference from Access.
This solution supose you don't have a very complex interaction between Access and Outlook and also the ProgId for OutlookObjects remained the same between version 12 and 14 of Outlook
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of ramrom
ramrom
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

I agree with capricorn1, late binding is the solution for this.

It will require some work to identify all of the Outlook constants you have used, but that is really just a matter of removing the Outlook reference, then debug-compile.

Identify the Outlook constant names and their values, then declare them in your code.  Then debug->compile again, to find the next one.  It is an iterative process, but once it is done, you will not have any problems.

BTW, you should be developing for the lowest level of Office, to ensure that you don't use a method or property that is only available on the later versions.
+1 for late binding. Trying to reset references, or add them, to a running application is never a good solution.

you should be developing for the lowest level of Office,
If you do this, then you really don't have to worry about late binding, although it's still a good idea. If you code in the lowest version of Office you must support Access will upgrade the references when you move to the newer platform (it cannot downgrade them, however).
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Scott, great info.  I didn't realize that Access would automatically upgrade the reference.  I've just always (ever since I started coding for multiple Office versions) just done the late binding.
Late Binding is the best way to handle this, without a doubt, but I have always made it a point to build to the "lowest common denomintor", and in my early days I never used Late Binding, and had no reference issues caused by incorrect versioning. I do extensively use Late Binding now.
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo