Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Access Database Version?

Status
Not open for further replies.

aesseal

Programmer
Nov 29, 2002
23
US
Does anybody know how to find what version of Access a database is written in (95, 97 etc)? I need to upgrade some 95 databases to 97 at run time using visual basic, so I need to know whether it is already in the right version or not.
The only way I have found so far is to open the database as a text file and look for 'Access95', but that's a real bodge!
Any suggestions would be gratefully accepted!

Dan
 
Set a reference to Microsoft Data Objects 3.6 Library or the highest you can find. Then try this code.

Option Explicit

Dim db As DAO.Database

Private Sub Command1_Click()

Call GetFileVersion

End Sub
Public Sub GetFileVersion()
Dim strFileName As String
strFileName = InputBox("What is the file name")
Set db = OpenDatabase(strFileName)
MsgBox db.Version
End Sub

'This is how the data mappings go:
'4.0 = Access 2000
'3.51 = Access 97
'2.5 = Access 95
 
And under ADO/ Jet you can do this:

conn.Properties("Jet OLEDB:Engine Type")

In thread222-371417 I have listed up the Jet Engine types. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top