permanently locking certain rows in a table???

  • Thread starter Thread starter dean
  • Start date Start date
D

dean

Can someone tell me whether it is possible to mark certain
rows in a table as non-deletable. I want some records to
be held in a common table but do not want them to be
deleted. Other records in the table can be deleted. Is
there an easy way of doing this??

Thanks,

Dan.
 
One "trick" might be to do something like this:

1. Create a new table with same primary key field(s) as your existing
table.

2. Create a one-to-one relationship with enforced referential integrity
(but without cascading deletes) from your existing table to the new table.

3. Add the primary keys of the records you don't want to delete from your
existing table into the new table.

This will prevent records in your existing table from being deleted if there
are related records in the new table. If you want to prevent users from
deleting records from the new table (and from subsequently deleting the
related records from your original table), you could secure your database
using user-level security and assign permissions accordingly.
 
Hmmm, I like the idea, but I'm not sure at this time
whether the organisation for which I am doing this will
want user names and passwords. I'll give it some thought,
though, thanks.
 
Without user-level security, how are you going to prevent users from
deleting your table altogether, let alone certain rows?

It is possible to have user-level security without requiring your users to
supply user names and passwords -- just assign the permissions you want them
to have to the built-in Users group of your (development) workgroup
information file. The Users group is common to all workgroup information
files, even the default one your users are probably already using without
knowing it. Item 32 in the Access Secuirty FAQ at

http://support.microsoft.com/support/access/content/secfaq.asp

touches on this. The FAQ has lots of other useful information if you decide
to go with the user-level security.
 
Back
Top