?
Solved

Application for multiple MSAccess versions 2003 2007

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

719 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