Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tablerevert() won't behave
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01087401
Message ID:
01087407
Vues:
16
It sounds like the record pointer is somehow being moved causing the changes to be committed before the tablerevert takes place. Is it possible for you to step through the code in the debugger to confirm this?



>Hi fellows!
>
>A little catchy one for the lots of ya: I'm using a quitButton class (derived from a standard button) contained in a commandgroup on every forms that appear in my app. When clicked on, the button checks if the user was editing the data. If not, it closes the form, but if the form is in editing mode, it first asks for confirmation from the user, then reverts any changes made to the table, and then closes the form.
>
>
>&&the _linkedalias property of the commandGroup contains the name of the alias mentionned in the form's data environment.  i.e.: this._linkedalias="usagers"
>
>lcAlias = this.Parent._linkedalias && property of the commandGroup containing
>LOCAL liRep as Integer
>IF thisform.editing
>    liRep = MESSAGEBOX(this.Parent._message, 4+32+256+4096, "Confirmation")
>    IF liRep = 6 && user answered 'yes'; release the form...
>	TABLEREVERT(.F., &lcAlias)
>	thisform.Release
>    ELSE  &&  user answered 'no'; do nothing...
>    ENDIF
>ELSE
>    thisform.Release
>ENDIF
>
>
>The problem occurs on one of my form when the user create a new record. A blank record in appended in the table, which the user then populate. If the user decide to quit the form before he's finished and has saved the changes, the form go through routine described above except it doesn't remove the blank record, and throws a 1884 exception the next time you try to add a new record. I use the same procedure on 12 other forms with more than 12 other tables and it works just fine. The cursors in my form's data environments all have their BufferModeOverride property set to 3 (optimistic row buffering).
>
>Any clue as to what's happening?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform