Solved

Application for multiple MSAccess versions 2003 2007

Posted on 2009-07-16
1
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

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

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

623 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