Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table Buffering vs Row Buffering
Message
De
24/07/2001 08:36:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
24/07/2001 08:08:22
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00533841
Message ID:
00534316
Vues:
13
>If TableUpdate(.T.,.T.,'vDetail') = .F.
> Tablerevert('vDetail')
> Wait Window ' Save record Failed! ' timeout 3
>Else
> Tableupdate(.T.,.T.,'Codes')
> Requery('vCodes')
> Requery('vDetail')
>Endif

This is a little apart from your main concern; but please note that, since TableUpdate() already returns a logical value, you don't need to compare it to another logical value to get a logical expression.

You can use:
if not TableUpdate(...)

or:

if ! TableUpdate(...)
Also, you might prefer to re-arrange your code to avoid the not (put the affirmative first):

if TableUpdate(.T., .T., 'vDetail')
Tableupdate(.T.,.T.,'Codes')
Requery('vCodes')
Requery('vDetail')
else
Tablerevert('vDetail')
Wait Window ' Save record Failed! ' timeout 3
endif


Another note: you can use transactions to save "All or nothing". RTFM, under: BEGIN TRANSACTION, END TRANSACTION, ROLLBACK. Please note that only tables that are part of a database can participate in a transaction.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform