Solved

Application for multiple MSAccess versions 2003 2007

Posted on 2009-07-16
1
194 Views
Last Modified: 2012-05-07
I'm developing an application that connects to different versions of MSAccess.
version 2003 in one computer, and version 207 in another computer.

The connection strings are different.

At the moment I'm using a Try-Catch clause.
If the 2007 connection string fails then the program tries again with the 2003 connection string.

Is there a more elegant way of checking which version is installed ?
0
Comment
Question by:avitalk
1 Comment
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 total points
ID: 24867972
You can automate Access (assuming it's available on the enduser machine) and then check the Application.Verion ... you'll get 11.0 for 03 or 12.0 for 2007. However, this is just as "kludgy" as using Try-Catch:

Dim acc As Object
Set acc = CreateObject("Access.Application")
acc.OpenCurrentDatabase "Full path to your db file"

If acc.Application.Version = "11.0" Then
  '/2003
Elseif acc.Application.Version = "12.0" Then
  '/2007
End If

You could also check registry keys, but that will show you only what versions are installed on the machine (if any) not what version of Access was used to create a specific file.
 
 
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question