I found it. Haven't yet confirmed that it works on 97, 2000, XP, and 2003.
GetAttr(Application.CurrentProject.FullName) And vbReadOnly
Vern
> I found it. Haven't yet confirmed that it works on 97, 2000, XP, and
> 2003.
>
> GetAttr(Application.CurrentProject.FullName) And vbReadOnly
It won't work for Access 97, as A97 has no "CurrentProject" property.
However, in any of these versions you ought to be able to use
CurrentDb.Name instead, unless you're working in an ADP:
GetAttr(CurrentDb.Name) And vbReadOnly
That won't work in an ADP, unfortunately, as CurrentDB returns Nothing
in an ADP.
Be aware that checking the read-only file attribute won't tell you if
the file is read/write but it's currently *opened* for read-only access.

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Vern Rabe - 20 Sep 2006 01:31 GMT
Thanks, Dirk. CurrentDb.Name did the trick.
Vern
> > I found it. Haven't yet confirmed that it works on 97, 2000, XP, and
> > 2003.
[quoted text clipped - 12 lines]
> Be aware that checking the read-only file attribute won't tell you if
> the file is read/write but it's currently *opened* for read-only access.