Deleting an Access Database File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a difficult time understanding something probably so simple.
If anyone can explain this to me, I would really appreciate it.

I am not on a network or server. Simply created a Mdb file and set it in a
folder on my C drive.
When I open the folder and right click on the file, I can delete it. So
easily.
How do you protect it from being deleted?
 
You can't really.

Using NTFS, it's possible to set permissions on the MDB file so that the
users don't have Delete on the file (they still must have it on the folder).
However, you'll run into problems when you go to compact the database. If
you try to compact without supplying a name for the resultant database (such
as is the case when you compact through the GUI), Access will be unable to
delete the old database once it's complete, so you'll end up with the
original database plus something like db1.mdb in the same folder. If you do
supply a name for the resultant database (as you can when you use the
CompactDatabase method in VBA), the new database file will inherit the
Delete permission from the folder.
 
You can delete ANY file on the same basis. In that respect, Access is no
different from anything else, and you are asking a Windows question really.

Permanent deletion requires a two-step process (delete from the recycle bin as
well), and that seems to be considered adequate protection from deletion of
files generally. That's a lot better than it was prior to Windows95 :-)

Chris
 
Back
Top