Retrieving Access version

  • Thread starter Thread starter Giobibo
  • Start date Start date
G

Giobibo

I have a mdb file: how can I know which is the access version (access
2.0, 95, 97, 2000, etc...) without opening the file with access?

thanks for replying.
 
Hi Giobibo,

Below is something that I have put together. Try this function through a
CommandButton a form where you would be asked to enter the fully qualified
file name of the Access file i.e.
C:\C:\somefoldername\thenameofthedatabase.mdb
You should assign this function to the button's OnClick event as
=ShowAccVer()
The code you should paste behind your form is given below.

Hope this resolves your problem.

Alp

'---------Code Start------------
Public Function ShowAccVer()
Dim Message, Title, Default, MyValue
Message = "Enter the Fully Qualified File Name" & vbCrLf & vbCrLf & _
"such as: C:\somefolder\databasename.mdb" ' Set prompt.
Title = "DataBase file location" ' Set title.
Default = "" ' Set default.
' Display message, title, and default value.
filename = InputBox(Message, Title, Default)
Dim DB As Database
Const conPropNotFoundError = 3270
Set DB = OpenDatabase(filename)
On Error GoTo ShowAccVer_Err
PVer = DB.Properties![AccessVersion]
DB.Close
Set DB = Nothing
Select Case Val(Left(PVer, 2))
Case 6
rdAccVer = "Database version is Access 95"
Case 7
rdAccVer = "Database version is Access 97"
Case 8
rdAccVer = "Database version is Access 2000"
Case 9
rdAccVer = "Database version is Access 2002"
End Select
ShowAccVer_Err:
If Err = conPropNotFoundError Then
PVer = DB.Properties![Version]
rdAccVer = "Application Version information can not be found. " &
vbCrLf & vbCrLf & _
"But the file's JET Engine Version is " & PVer
End If
Response = MsgBox("for " & filename & vbCrLf & vbCrLf & rdAccVer, vbOKOnly,
" DataBase Version Information")
End Function
'-----------Code End-----------------
 
Back
Top