Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Datawindow

22 views
Skip to first unread message

Clark

unread,
Jul 17, 2003, 1:28:58 PM7/17/03
to
Hi, I have a problem...
I have two dw a window itis code event ue_update()

If dw1.Update()=-1 Then Goto Error
If dw2.Update()=-1 Then Goto Error

SQLCA.of_Commit()
Return
Error:
SQLCA.of_Rollback()

I insert row a two dw then
when I've executed event window ue_update() first time I don't have
problem... Then add row to dw2 and execute event ue_update() second time
show error dw2

Database error code : -3
Database error message
Row changed between retrieve and update

please help me.......!

PowerObject!

unread,
Jul 21, 2003, 3:07:30 PM7/21/03
to
If your first call to ue_Update failed, it goes to the Error label -
resetting the UpdateFlags of the dw by default. On the second call to
ue_Update, the dw's status flags might be wrecking havoc bombing your
update logic! In case of multi-dw update, always use the ResetFlag argument
of the Update() function:

IF dw_1.Update( TRUE, FALSE ) = 1 THEN
//
IF dw_2.Update( TRUE, FALSE ) = 1 THEN
SQLCA.of_Commit()
dw_1.ResetUpdate() // Reset the update flags
dw_2.ResetUpdate()
ELSE
GOTO Error
END IF
//
ELSE
GOTO Error
END IF


ERROR:
SQLCA.of_Rollback()


---
PowerObject!
-----------------------------------------
http://Groups.Yahoo.com/group/PowerObject
PowerBuilder / PFC Developers' Group

0 new messages