Detect Version of Access

M

MDW

Hey all,

I'm trying to use VBScript to detect two things:

1) if a user has Access
2) if yes, which version of Access they have.

Question #1 can be answered by the following -

On Error Resume Next

' Before we bother to hook this user up with the
application, we need to make sure that they even have
Access on their machine
Set objAccess = CreateObject("Access.Application")
On Error GoTo 0

If Err.Number <> 0 Then ' If there was an error creating
the application, then there is a 99% certainty that they
don't have Access

MsgBox "You do not have Microsoft Access installed
on your computer. You cannot use the GBMS Warehouse
application.",vbExclamation,"Access Not Detected"
Err.Clear

Else

' They have it

End If

However, I'm trying to figure out how to determine what
version of Access they have. objAccess.Version doesn't
work; I get "Object does not support this property or
method". If I try objAccess.CurrentDb.Version, I get the
same thing.

Does anyone know what objects/properties I can use, and
what values correspond to which versions of Access?

Thx.
 
J

Juan M. Afan de Ribera

You need to use something like

retVal = objaccess.SysCmd(acSysCmdAccessVer)

select case retVal
case "8.0": msgbox "Access 97"
case "9.0": msgbox "Access 2000"
case "10.0": msgbox "Access 2002"
end select

HTH
 

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