?
Solved

How to Check What Version of Access MDB file before openning the file ?

Posted on 2003-03-09
5
Medium Priority
?
399 Views
Last Modified: 2012-11-01
Say, U are running Access 2002 and the code is trying to open a second MDB in Access 2000, 97 or 2 versions.

Is there a function that can return what version that it is openning ?

Any suggestion ?

Sebastian Dieu
0
Comment
Question by:sebdieu
[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
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
mcallarse earned 500 total points
ID: 8101167
How are you trying to open the second database? Following should work.

Function GetVersion(DbName)

Dim db As Object
Dim strVersion As String

On Error Resume Next

Set db = DBEngine.OpenDatabase(DbName)
With db
  strVersion =  .Properties("AccessVersion")
  .Close
End With
Set db = Nothing

If Not Err.Number=0 Then
  Err.Clear
  strVersion=-1
End If

GetVersion = strVersion

End Function
0
 
LVL 9

Expert Comment

by:mcallarse
ID: 8101252
Take Two...

Public Function GetVersion(DbName)

Dim db As Object
Dim strVersion As Integer: strVersion = -1

On Error Resume Next

Set db = DBEngine.OpenDatabase(DbName)
With db
    Select Case Int(Left(.Properties("AccessVersion"), 2))
    Case 2: strVersion = 2
    Case 6: strVersion = 7
    Case 7: strVersion = 8
    Case 8
        If .Properties("RowLimit") Is Nothing Then
            strVersion = 9
        Else
            strVersion = 10
        End If
    Case 9: strVersion = 10
    Case Else: strVersion = 0
    End Select
 .Close
End With
Set db = Nothing

GetVersion = strVersion

End Function
0
 
LVL 12

Expert Comment

by:nexusnation
ID: 8785434
Hi sebdieu,
This question has been abandoned and needs to be finalized (105 days since last comment).

   You can accept an answer, split the points, or get a refund. Go to
   http://www.cityofangels.com/Experts/Closing.htm for information and options.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

nexusnation
EE Cleanup Volunteer for Microsoft Access
0
 
LVL 18

Expert Comment

by:1William
ID: 8885638
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept question, points to mcallarse
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

1William
EE Cleanup Volunteer
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

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.
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.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

765 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