Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableUpdate(), Pls Help
Message
From
16/07/2004 23:46:49
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00925076
Message ID:
00925436
Views:
22
Hi Viv,

Thanks your reply,

Re: TableUpdate()
Can you pls explain why it will not save records in TableB, what is the work around?

Re: CHange of record pointer
For I am only updating one record in TableA, in fact the problem comes when I do the following
** I am on record 10
TableRevert(.t.,"TableA")
** still on record 10
do something
TableUpdate(1,.f.,"TableA")
** still on record 10
** move to record 15
do something
TableUpdate(1,.f.,"TableA")
** record pointer moves back to 10
Why?? Any Answer???


>Hi,
>
>>>
>I have a form with two tables, both are using "5-Optimistic Table Buffering".
>
>TableA has one-to-many relationship with TableB. When a record is changed in TableA, there are more than one Records affected in TableB.
>
>When I want to issue Table Update, what should I do?
>
>Currently I am using
>TableUpdate(1,.f.,"tableA") and
>TableUpdate(1,.f.,"tableB")
>
>Is it correct?
>>>
>
>There is a danger that the update to tableA will succeed but the update to tableB will fail. Use a transaction to wrap the two updates:
>
>BEGIN TRANSACTION
>IF TABLEUPDATE(1,.f.,"tableA") .AND. TABLEUPDATE(1,.f.,"tableB")
>  END TRANSACTION
>ELSE
>  ROLLBACK
>  * Handle the failure
>ENDIF
>
>
>>>
>I have another problem where when after I issue TableRevert(.t.,"TableA") while on record number X, if I go to Record number Y and issue TableUpdate(1,.f.,"TableA"), the record number changes to X automatically.
>>>
>
>From TableUpdate Help:
>If table buffering is used and multiple records are updated, TABLEUPDATE( ) moves the record pointer to the last record updated.
>
>HTH,
>Viv
Regards
Shaishav
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform