Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect changes in DBF
Message
 
 
À
20/01/2018 12:48:05
Walter Meester
HoogkarspelPays-Bas
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:
01657407
Vues:
74
>>>>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
>>
>>That would be a good idea, however I do not have a DBC. It is a very old database from FPW26 converted and it would be too much work to add a dbc.
>
>I did sopmething like that in the old days. Having an index with a filter on a function. That function evaluates whenever a change is made in the record.
>The function set a boolean field to .T. to indicate that a change is make. the trick is to make sure the function is available (preferably a PRG) whenever you make a change.
>
>Walter,

That is a good idea, I could set a timefield value and then the process could check which records were updated, so the update could be more specific.
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform