Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete routine , refreshing the form
Message
From
05/03/1999 12:51:33
 
 
To
05/03/1999 11:58:00
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00194554
Message ID:
00194606
Views:
17
David:
I would restructure it to something like the following (I'm assuming you want the whole transaction to fail if one update fails):
LOCAL llSuccess
llSuccess = .T.
BEGIN TRANSACTION
FOR EACH lcTableNumber IN THISFORM.latables
	IF .NOT. TABLEUPDATE(.T.,.T.,lcTableNumber)
		ROLLBACK
		llSuccess = .F.
		EXIT && Stop trying to update
	ENDIF
	IF llSuccess
		END TRANSACTION
	ENDIF
NEXT
*!* Now you've got to do something about all the buffers.
*!* Least kind to the use would be something like:
FOR EACH lcTableNumber IN THISFORM.latables
	TABLEREVERT(.T.,.T.,lcTableNumber)
NEXT
As for the deleted problem: is SET DELETED ON? (Keep in mind SET DELETED is scoped to the current data session.)

>He guys,
>First i want your honest opinion about my delete routine in my
>delete method, i recently started to put transactions in my
>applications and i don't know much about them so.
>
>second
>I have problems when i delete the record and i do a refresh
>of the form the you still see the record on the form.
>
>
>begin transaction
>for each lctablennumber in thisform.latables
>select (lctablenumber)
>if tableupdate(.t.,.t.)
>else
>messagebox("Table can not be updated")
>" , 16 , "failure...")
>rollback
>exit
>endif
>endfor
>end transaction
>endif
>thisform.refresh
>
>Thanks for your opinion
>david
Previous
Reply
Map
View

Click here to load this message in the networking platform