Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function IsMDE(db As Database) As Boolean
' It works on the fact that an MDE database has a property of "MDE" added with a value of "T"
' This is far more reliable and less risky than checking the file extension or attempting to access
' form or report design or VBA module code with an error handler.
'
' The use of the DAO Properties collection,
' For...Each...Next loop and On Error Resume Next handler
' gets around the problem of not having the property in an
' MDB database which otherwise causes run time errors.
Dim prp As Property
IsMDE = False ' Assume it is not an MDE file.
On Error Resume Next
For Each prp In db.Properties
If prp.Name = "MDE" Then
If prp.Value = "T" Then IsMDE = True
Exit For
End If
Next
End Function
If IsMDE (CurrentDb) Then
MsgBox "This database is in MDE format", vbOkOnly+vbInformation
Else
MsgBox "This database is not in MDE format", vbOkOnly+vbInformation
End If