Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I lock a record.
Message
De
11/12/2006 17:02:04
 
 
À
11/12/2006 10:31:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01176549
Message ID:
01176691
Vues:
9
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform