Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I lock a record.
Message
From
11/12/2006 17:02:04
 
 
To
11/12/2006 10:31:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01176549
Message ID:
01176691
Views:
8
>I have an SPC inspection program. ISO guys are requiring that I lock the data so that it can't be edited after a certain point.
>
>How can I lock certain records in a table so that they can't be edited.
>
>It's in a database.

first you must to build a write once field ( as a worm disk ),
then you use this like a rw flag into field's check rule, record check rule.
CLEAR
CREATE CURSOR testlock (data I CHECK RW,RW L DEFAULT .T. CHECK CURVAL("RW")) 
APPEND BLANK
REPLACE data  WITH 1
REPLACE RW WITH .T.
&& NOW THE RW FIELD BECOME A STATIC FIELD
REPLACE RW WITH .F.	

* every field with check RW become read only
REPLACE data  WITH 2

* rw can't  return to .T.
REPLACE RW WITH .T.	

? DATA,RW
this is a deceptive solution, and every true ISO guy has to discard it
If you want true read only records then you must write the records into a true worm disk
Previous
Reply
Map
View

Click here to load this message in the networking platform