Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Application for multiple MSAccess versions 2003 2007

Posted on 2009-07-16
1
Medium Priority
?
208 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 150 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…
Suggested Courses

772 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