Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tableupdate problem
Message
 
 
À
17/12/2008 07:52:48
Mk Sharma
Shrishti Solutions
Mumbai, Inde
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 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01368056
Message ID:
01368066
Vues:
17
>i am trying to update a child table with below code :
>
>i have added 3 new records but only one record is inserted in "inward1.dbf"
>
>"updres" class is created by "Andy Kramek"
>
>
>how to update a child table with many records and with conflict resolution .
>
>
>LOCAL llOk, oUpd, laErr[1]
>*** Select the main table 
>SELECT inward1 && child table 
>*** Try and update
>*** If update fails, create the conflict resolution object
>lnNextRec = 0
>DO WHILE .T.
>   lnNextRec = GETNEXTMODIFIED(lnNextRec)
>   IF lnNextRec = 0
>      EXIT
>   ENDIF
>   llOk = TABLEUPDATE()
>   IF ! llOk
>      AERROR( laErr )
>      IF laErr[1] = 1585
>         oUpd = CREATEOBJECT( 'updres', THISFORM.DATASESSIONID, ALIAS() )
>         IF TYPE( 'oUpd' ) = "O" AND ! ISNULL( oUpd )
>            oUpd.SHOW()
>         ENDIF
>      ELSE
>*** What other error could we get here?
>         MESSAGEBOX( MESSAGE(), 16, "Whoops!" )
>      ENDIF
>   ENDIF
>ENDDO
>*** Refresh the form
>THISFORM.REFRESH()
>
>
>
>warm regards,
>mk.

Specify all the parameters for tableupdate explicitly. Do you want to update one record in a time only? I would instead update all records at once.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform