Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Tables + Relationships _ Can I Lock The Table

Posted by: NimishParikh Nov 20 2019, 05:59 PM

Hi,

Can I lock the table in the database. Once I have defined the table, I don't want user to change it in any way.

Nimish

Posted by: theDBguy Nov 20 2019, 06:00 PM

Not in Access, I don't think so. Why?

Posted by: isladogs Nov 20 2019, 06:07 PM

Actually it is possible but its not easy to do as it involves changes to a system table
However there should be no reason to do so as end users should never have direct access to tables or queries.

If you want to prevent changes to the table design, suggest you hide the table and the navigation pane.
Or split the database so the table is in an encrypted backend file.
Or you can open the entire database read only

To prevent data changes, there are several approaches
1. Create a query SELECT DISTINCT * FROM TableName and use that as the record source for a form
2. Use the table as your form's record source and set Allow Edits, Allow Deletions, Allow Additions all false
3. Use your table as the record source for a subform and lock the subform

Posted by: GroverParkGeorge Nov 20 2019, 06:55 PM

Please clarify. We assume that you mean you want to lock the records in the table so none of the values can be changed. However, "I don't want user to change it in any way" could mean that you don't want the table structure to be changeable.