Solved

Application for multiple MSAccess versions 2003 2007

Posted on 2009-07-16
1
167 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now