Walter Meester
HoogkarspelNetherlands
General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows Server 2012 R2
Likes (1)
Christian Isberner
>>>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,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only