How to detect an .ade database programatically - Access 2003

R

Ray

For years I have used a code snippet to detect if an Access database was and
MDE or an MDB.

I cant find out how to do that for an .ade

Is it possible?
 
C

Chris O'C via AccessMonster.com

Check the project's mde property. Yes, really.


Public Sub testIsADE()
Debug.Print isADE("c:\data\myproj.ade")
End Sub


Public Function isADE(sPath As String) As Boolean
On Error Resume Next

Dim app As Access.Application
Dim strMDE As String

Set app = CreateObject("Access.Application")
app.OpenCurrentDatabase sPath, False
strMDE = app.CurrentProject.Properties("MDE")
isADE = (Err.Number = 0 And strMDE = "T")
app.Quit
Set app = Nothing
End Function

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top