Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GO to a negative recno in a optimistic table buffered cu
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 6 SP5
Divers
Thread ID:
01031593
Message ID:
01031793
Vues:
9
It must works, Try this to see what happens (if you have time :o):
ng in the PreSaveHook method of biz obj:
IF THIS.IsNew()
   ACTIVATE WINDOW "Debug Output"
   DEBUGOUT "ALIAS Before ResetPrimaryFlag "+ALIAS()
   DEBUGOUT "RECNO Before ResetPrimaryFlag "+TRANSFORM(RecNo())
   THIS.ResetPrimaryFlag() && Reset previous records Primary flag to 0
   DEBUGOUT "ALIAS After ResetPrimaryFlag "+ALIAS()
   DEBUGOUT "RECNO After ResetPrimaryFlag "+TRANSFORM(RecNo())
   REPLACE cPointer_fk         WITH v_patients.cPatients_pk, ;
           cPointer_table_name WITH 'PATIENTS', ;
           cUsgrlink_fk        WITH THISFORM.cUsgrlink_fk , ;
           iPrimary_flag       WITH 1
   this.cAction_Code = "AD"	
ELSE
   REPLACE cUsgrlink_fk WITH THISFORM.cUsgrlink_fk
   this.cAction_Code = "CH"
ENDIF

*---------------------- Location Section ------------------------
*   Library: 	Abizness.vcx
*   Class: 		Abizobj
*   Method: 	Resetprimaryflag()
*----------------------- Usage Section --------------------------
*)  Description:
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	07/07/2005 - WGB
*		MODIFIED
*----------------------------------------------------------------
LOCAL loSelect, lnCurRec, lcAlias

loSelect = THIS.SelectAlias()
DEBUGOUT "ALIAS After SelectAlias "+ALIAS()
DEBUGOUT "RECNO After SelectAlias "+TRANSFORM(RecNo())
DEBUGOUT "RECCOUNT After SelectAlias "+TRANSFORM(RecCount())

IF RECCOUNT() > 1
   lnCurRec = RECNO() && Save the current record
   lcAlias = ALIAS() && primary view of the biz object
   UPDATE (lcAlias) SET iPrimary_flag = 0 WHERE iPrimary_flag = 1
   GOTO lnCurRec && Return to the record
ENDIF
And see if there is something suspicious
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform