Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detect installed version of MS Office or Access runtime

Status
Not open for further replies.

MBorofsky

Programmer
Nov 24, 2004
47
US
For various reasons we needed to make our Access database an MDE file. It appears that each MDE is specific to Access 2000, 2002, and 2003 meaning there will need to be a different front end for different computers.

In order to create a nice smooth install process I want to write a program that:

1) Detects if Microsoft Office is Installed and what version (2000, 2002, or 2003)
2) Detects if Access runtime installed (plus version)

That way the install program could detect which MDE to copy onto the user's computer. I will be writing the install program in VB6 so either code that can output a text file from another language or VB6 code directly would be very helpful.
 
hi,


I'm not sure about your initial statement that each mde is version specific, but if so, why don't you develop in Access 2000? The mde should run on each higher version (I know, I develop this way (MsAccess2000) at the job, but use 2003 privately).

If you want you could check the registry:

You can check the installation versions by looking for the registry. I believe it is stored here:
Code:
"HKEY_CLASSES_ROOT\access.application\curver

"Access.Application.9" for
version 2000 and "Access.Application.10" for Office 10 (2002? -> not sure which nr corresponds with which version).

Easyit
 
An MDE compiled in 2000 doesn't always run on systems with 2003. It seems to be very sporadic because sometimes it will run and sometimes it won't. The only constant we found in testing was that an MDE compiled on 2000 runs on runtime or full 2000, compiled on 2002 runs on ... 2002, ect.

I look on my system and I have .9, .10, and .11 in that registry location. Mine is one of the computers that runs all 3 MDE's so I will send this over to testing to see if that works and let you know, thanks.
 

This function returns the major version of access

Function AccessMajorVersion() As Integer

Dim objAccess As Object

Set objAccess = CreateObject("Access.Application")
objAccess.NewCurrentDatabase "C:\TestVersion.mdb"
AccessMajorVersion = objAccess.Application.VBE.ActiveVBProject.References("Access").Major
objAccess.CloseCurrentDatabase
Set objAccess = Nothing
Kill ("C:\TestVersion.mdb")

End Function

And if you create an excel or outlook object (named objApp) you should get the version in this

TestAppVersion = Val(Mid(objApp.Version, 1, InStr(1, objApp.Version, ".") - 1))
 
SysCmd (acSysCmdAccessVer) returns the major Access version:

9.0 for 2000
10.0 for XP
11.0 for 2003

SysCmd (acSysCmdRuntime) returns True if the current version of access being used is a runtime version.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top