Ask Your Question
0

Protect records in Base

asked 2017-10-04 22:57:00 +0100

Leroy gravatar image

updated 2017-10-04 23:11:09 +0100

Here is a wierd one. I have a database of bin locations that correspond to records in my database. The bins need to "line up" with the records. I need to make my form so that it is NOT POSSIBLE to delete a record in my table. Deleting a record will mean that the location where an item is will no longer show up in the database. I have already loaded my table and now I need to "protect" the records while still allowing the user to edit any information except the Record ID. Another way to ask this question is: How do I allow fields in a database form to be edited while removing the ability for the record containing the fields to be deleted?

edit retag flag offensive close merge delete

Comments

It would help to know what DB you are using - embedded, split, other external (MySQL, PostgreSQL, etc).

Ratslinger gravatar imageRatslinger ( 2017-10-04 23:22:09 +0100 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2017-10-05 13:39:29 +0100

pierre-yves samyn gravatar image

Hi

If the question is :

make my form so that it is NOT POSSIBLE to delete a record in my table.

No need to create groups & users:

  • Edit Form PropertiesData tab▸Allow deletionsNo

If the question is :

while still allowing the user to edit any information except the Record ID.

  • Each field can be Enabled or not, or Read-only or not (PropertiesGeneral tab)

Regards

edit flag offensive delete link more

Comments

I feel really stupid that I did not think of that. This answer works perfectly. Thank you!

Leroy gravatar imageLeroy ( 2017-10-06 23:59:35 +0100 )edit
1

answered 2017-10-04 23:57:46 +0100

Ratslinger gravatar image

This question is not weird but actually a very common situation. The solution is simple enough. You need to create users with different privledges.

Typically in a database you can give different rights to different users or groups. These rights can include updating, selecting, deleting and inserting for tables. Depending upon the database, you can do this at the column level.

You would use SQL to CREATE/DROP USER then GRANT or REVOKE privledges as needed.

Best to refer to the documentation of the database, paying careful attention to the version you are using and looking at. Even with the same database type, different versions have different capabilities. This is evident in HSQLDB v1.8 vs v2.x. The earlier version had no means for control on table columns.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-10-04 22:57:00 +0100

Seen: 88 times

Last updated: Oct 05 '17