Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect changes in DBF
Message
De
19/01/2018 02:10:39
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01657364
Message ID:
01657365
Vues:
64
>Following problem: I have a DBF table that is open shared by multiple users. I like to detect if changes are done to the table, but since the table is opened shared and in use the timestamp of the actual DBF file does not change, until all users have closed the table.
>
>To do a query and comparison by content would be too slow. So I was wondering if there is some low level function approach I could use to detect the before-after differences? The simplest would be Reccount(), but I need to detect content changes where it does not change the recordcount.

Christian,

Use a trigger

in the table properties, replace the trigger expression with the current trigger() AND yourtrigger()

If it's an insert there's a change
if it's a delete, there's a change

if it's an update, you may need to compare ( don't remember) each field with its previous value - watch out for nulls when comparing

Remember, within a trigger

- you cannot modify the current table, not even go off the record
- you can open, change and close other tables
- restore the workarea if you have changed it
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform