Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date of Last Update Field...
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00362891
Message ID:
00363738
Views:
20
>Sorry, I was not aware about deletion problem. Just a guess (haven't checked it), may be we can use Delete Trigger for this?
>
>What about delete - then recall?
>
>I'll check this.
>
>Thanks for the info.
>

No we can't. I have tried this, and no success "Unable to modify Cursor" or similar msg. In my case I need to track the datetime of all deleted records, my not very good solution (by hand in the forms or code):

REPLACE LastUpdate WITH DATETIME
=TABLEUPDATE(0,.T.,ALIAS())
DELETE
=TABLEUPDATE(0,.T.,ALIAS())

This is needed for views, if working against a table you can override the first tableupdate and embbed in a transaction.

Another try (but still don't like it)

REPLACE auxfield WITH .T.

And inside the transaction:

REPLACE ALL LastUpdate WITH DATETIME FOR axutfield = .T.
=TABLEUPDATE(1,.T.,ALIAS())
DELETE ALL FOR auxfield = .T.
=TABLEUPDATE(1,.T.,ALIAS())

In the first sample It's impossible to put it into a transaction, the second needs an extra field for flaging the deleted records!!! And the second could be slow if you havent an index by the auxfield.

These samples talk regarding views, in tables the things are diferent. Why don't works in views? Cause VFP don't update any field of a deleted record, this is by design.

If you have another better solution please let me know.
Pablo Roca
Clavo Congelados, S.A. (La Coruna - Spain)
Sysop of PortalFox

Join MasFoxPro campaign
http://www.masfoxpro.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform