Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

locking records once they are entered

Status
Not open for further replies.

cdthomas9

MIS
Jun 18, 2003
3
US
I have several tables set up in my database, and I want to be able to lock the record once it is entered. My users keep complaining that data is disappearing, but I think theyre just incompetent and are accidently deleting the data. If anyone has an answer or a tip, I would be appreciate it very much. Thanks!
 
To the best of my knowledge, there is no feature built into MySQL to do what you want.

One solution is to add a column to the table in question, and have any application which will delete from the table delete only those rows where that column is set to 0.

Want the best answers? Ask the best questions: TANSTAAFL!
 
no, the users are removing the data, not the application. having the column would help if i could block the users from removing the data once its in.
 
I understand your problem. I was unclear in my first answer -- let me try again.

There is no mechanism in MySQL whereby a record can be locked so that no mechanism, prior to unlocking the record, can prevent deletion of that record.

It sounds to me that whatever application your users are using to manipulate the data, that application has no mechanism within it to perform these locks, either. Or if it does, that mechanism is not functional.

You might be able to modify your tables by adding a column named "can_delete", which has a default value of 1. If you need to protect a row, change the value in that row's "can_delete" record to 0. Then modify the application so that it will not delete a row, the "can_delete" column of which is 0.

Want the best answers? Ask the best questions: TANSTAAFL!
 
There should be -- but the exact method I do not know.

If you are using Access in its standard form (no VB or VBA application running) probably not.

If you are running a VB or VBA application within Access, then that application could be modified to not delete records that are flagged.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top