Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tablerevert()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00571637
Message ID:
00571675
Vues:
21
Hi!

I do not understand what you're going to do with tablerevert(). Tablerevert revert changes at the local computer in the buffered record. As a result, you lose changes. If you try to update and have invalid records, use transaction for that. Something like following:

begin transaction
* loop through all modified records using GetNextModified() function and update only single record
* try to update
* if failed - leave this record alone and proceed further
END transaction

In above process you will have all valid records updated when all invalid will still be marked as not updated and wait for user confirmation or changes after alert to user. Of course, you can "rollback transaction" ALL changes at once that is usually recommended to maintain data integrity (in case several records are related).

HTH.

>I have a table that gets updated thru a cursor using tableupdate(). The table cannot have null values in 2 columns. If the cursor tries to add a blank record to the table, I can trap the error and do a TableRevert(). The problem is - it reverts back changes to all the records and not just the problem record as son as it encounters a problem. How can I ensure it will update all the good changes and discard only the invalid records ?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform