permanently locking certain rows in a table???

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.
 
B

Brian Camire

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.
 
D

dean

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.
 
B

Brian Camire

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.
 

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