0

I have created access front end ACCDR from Access 2016. In order for users to use this file, users need to install Access runtime 2016.

Most of my users already have MS Office 2007 or 2010 installed. So, when users try opening the ACCRD file, after install Access runtime 2016. They still get an error as they are opening the file using the older version of Access (aka 2010) and not the 2016 version.

My question:

How to check if the user has the correct version of Access set as default? I am fine with paying for a software which checks this. I am also fine with editing registry if any or importing registry if any.

[ACCDR files are created by renaming ACCDE (Access compiled files)].

2
  • why not simply ask the COM what version is registered as default ? Commented Aug 21, 2017 at 7:27
  • @Stavm, can you please elaborate on how that can be done. Commented Aug 21, 2017 at 7:45

2 Answers 2

3

You can read the version directly:

Version = Application.Version

Should return "16.0". If not, pop a message to the user to open using Access 2016.

Even better, provide a shortcut for the user to open your app with the runtime.

Sign up to request clarification or add additional context in comments.

6 Comments

After you see the user is running an early version, Open Runtime version in VBA.
@marlan: That would just open the default Access in runtime mode.
Where Do I put this code? (I am new to Access Programming) I Tried adding the code to default form which opens when Access file is opened. onLoadevent. But since the access can not recognize the database compiled with newer versions of Access, it does not load the form.
You could try a macro - or reveal your secret code.
Find where the runtime version exec is located, and open it using Shell() Function: Var = Call Shell ("C:\RuntimeDirectory\RintimeExecutible.exe PathToAccessFile.mdb"). Please note the space between the EXEC, and the file you send as an argument
|
1

Best approach would be to query the COM just after you launched the process and act accordingly.

if you don't have an access process already running, just start one, query it, and do your stuff in the process that you just invoked.

   Microsoft.Office.Interop.Access.Application _accessApp = new Microsoft.Office.Interop.Access.Application();
   string version = _accessApp.Version;       

Match the version string against Microsoft's version history: https://en.wikipedia.org/wiki/History_of_Microsoft_Office

for office 2016, the string you're looking for is 16.0


Another approach is checking the GUID of office via the registry and comparing it to a known office guids (they aren't random).

https://superuser.com/questions/1140114/how-to-detect-microsoft-office-version-name

1 Comment

Thanks a ton for the link. It helped me understand how registry values can help in knowing which version is Installed. I could not understand query the COM just after you launched the process

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.