What type of file am I?

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Using Access ‘03

Is it possible for an Access file to know what type of file it is?

E.g.,

If FileExtension = .mde then
‘Run some code
Else
‘nothing
End IF

Thanks,
alex
 
Using Access ‘03

Is it possible for an Access file to know what type of file it is?

E.g.,

If FileExtension = .mde then
‘Run some code
Else
‘nothing
End IF

Thanks,
alex


If Right(CurrentDB.Name,3) = "MDE" Then...
 
m:
Using Access '03

Is it possible for an Access file to know what type of file it is?

E.g.,

If FileExtension = .mde then
'Run some code
Else
'nothing
End IF

Not a good idea, as a file can be any arbitrary file extension.

What you want is:

CurrentProject.ProjectType

Also, for MDBs,

CurrentProject.FileFormat

can help you distinguish between the various versions of the MDB
file format.

I don't have A2007 installed to test, but I assume constants have
been added to the enums for these in order to cover the new file
format and its variants.
 
Back
Top