Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tableupdate problem
Message
 
 
To
17/12/2008 07:52:48
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01368056
Message ID:
01368066
Views:
18
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform