Check version of access

N

Nigel

How would I check the version of access in code.

I want to be able to check the version of access and if is access 2000
ignore some code other wise run the code

ie:

if access version =2000 then exit sub
 
D

Dave Patrick

Function AccessVersion()
Dim oShell
Set oShell= CreateObject("WScript.Shell")
Select Case oShell.RegRead("HKCR\Access.Application\CurVer\")
Case "Access.Application.8"
AccessVersion = 8 '97
Case "Access.Application.9"
AccessVersion = 9 '2000
Case "Access.Application.10"
AccessVersion = 10 '2002
Case "Access.Application.11"
AccessVersion = 11 '2003
End Select
Set oShell= Nothing
End Function


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| How would I check the version of access in code.
|
| I want to be able to check the version of access and if is access 2000
| ignore some code other wise run the code
|
| ie:
|
| if access version =2000 then exit sub
|
 
D

Douglas J Steele

Are you sure that will return the correct value in the case where multiple
versions of Access exist on the machine?

Assuming this is from within Access, you could look at
SysCmd(acSysCmdAccessVer)
 
D

Dave Patrick

It's always worked for me. AFAIK the last version in use determines the
current version in the case of a multi-version install. So if run from
within an Access session, it should return with the MDB version currently in
use.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Are you sure that will return the correct value in the case where multiple
| versions of Access exist on the machine?
|
| Assuming this is from within Access, you could look at
| SysCmd(acSysCmdAccessVer)
|
| --
| Doug Steele, Microsoft Access MVP
|
| (no e-mails, please!)
 
J

Joseph

This is just what I was looking for. I have from Office 2000 to Xp Pro to
Office 2007 on my network.

Thanks
 
Top