How to determine version of Access from a .NET 3.0 app?

D

David

I need to be able to use PIA's to invoke Access 2003 OR Access 2007 from the
same .NET 3.0 application.

But I would rather not have to include a reference to BOTH the 2003 and the
2007 PIA in my app (if that's even possible). Instead, I plan to implement
an interface layer that will dynamically load the appropriate PIA.

But how can I first determine what version of Access is installed on the
system, in order to then load the correct PIA? For example, I can't use the
version property of the Access.ApplicationClass, because to get to that
point, I already have to loaded the correct PIA. Do I have to enumerate the
assemblies in the GAC? Or something similar?
 
T

Tony Toews [MVP]

David said:
But how can I first determine what version of Access is installed on the
system,

In a similar situation I read the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Access\InstallRoot
(inserting the appropriate version number of Access of course) As a
double check, I then ensured that msaccess.exe actually exists in that
folder specified. But I'm a pessimist.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top