Access Version being used

O

oldjay

This work only if the version of Access matches the version of Excel. How do
you detect the Access version being used?


Private Sub CommandButton5_Click() 'Go to customer database
Dim X As String
Dim nVer As Long

nVer = Val(Application.Version)

MainMenu.Hide

If nVer = 11 Then

X = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
\\SERVER3\database\Customers.MDB", 1)
Else

If nVer = 12 Then

X = Shell("c:\Program Files\Microsoft Office\Office12\MSACCESS.EXE
\\SERVER3\database\Customers.MDB", 1)

Else

If nVer = 9 Then

X = Shell("E:\Program Files\Microsoft Office\Office\MSACCESS.EXE
\\SERVER3\database\Customers.MDB", 1)

End If
End If
End If

Application.Goto Reference:="Company"
Range("A3").SelectX = Shell("d:\Program Files\Microsoft
Office\Office11\MSACCESS.EXE \\SERVER3\database\Customers.MDB", 1)
End Sub
 
J

joel

Access databases can only be used with the same version of Access tha
there were created in . Access is not forward nor backwards compatibl
with different versions. You are using a shell command to open th
database which will use the version of Access that is installed on you
PC and if it doesn't match the version of the Database on the next wor
it will not work.

The better method is to connect with the database using the ADO metho
which will work across different version of Access. there are plenty o
references on the network on how to do this. He is one article

'VB Tutorials - SQL for Beginners' (http://tinyurl.com/6hulo
 
O

oldjay

I don't understand. We have a Access database created with 97 and it is used
with Access & Excel 2000. 2003 and 2007. as the working macro below shows
 

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