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

where to place dw_1.settransobject(SQLCA)?

632 views
Skip to first unread message

Rony Santoso

unread,
Feb 12, 2005, 8:48:51 AM2/12/05
to
Hi,

I am confused as to why datawindow couldn't link to the transaction object
specified at open event of a window.

please have a look at the following code:


-----------------
window.open()
--------------------
dw_1.of_settransobject(SQLCA)
cb_refresh.event clicked()


-----------------------
cb_refresh.clicked()
-----------------------
long ll_result

ll_result = dw_1.event pfc_Retrieve()
IF ll_result = -1 THEN
SQLCA.of_Rollback()
MessageBox("Error","Retrieve error")
ELSE
SQLCA.of_Commit()
dw_1.SetFocus()
END IF


The code above will produce error:
a database error has occurred
database error code = -1
database error messagE:
database transaction information not available
Call settrans or settransobject function
---------------------------------------------


The strange thing was that if I move statement
"dw_1.of_settransobject(SQLCA)" from window.open() to cb_refresh_clicked()
then suddenly everything runs normal (i.e. dw can make the link to SQLCA
successfully)

At first I thought it was because of the PFC, but after I tested using
dw_1.settransobject(SQLCA) and with dw_1.retrieve()
I still got the same error message.

Have you got any idea for this?

thanks,
rony


Paul Horan[TeamSybase]

unread,
Feb 12, 2005, 11:16:01 AM2/12/05
to
"Rony Santoso" <ron...@yahoo.de> wrote in message news:420e093e@forums-2-dub...


Are you changing the dataobject at any point, either with a direct "dw_1.dataobject = " or with a Modify() or
SetSQLSelect() statement?

--
Paul Horan[TeamSybase]


Rony Santoso

unread,
Feb 13, 2005, 10:40:40 AM2/13/05
to
yes i did, the code was put at ancestor window and failed at descendant

"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:420e2bc1$1@forums-1-dub...

Paul Horan[TeamSybase]

unread,
Feb 13, 2005, 3:42:53 PM2/13/05
to
"Rony Santoso" <ron...@yahoo.de> wrote in message news:420f74f8@forums-1-dub...

> yes i did, the code was put at ancestor window and failed at descendant
>


Then you have to do another SetTransObject(). You can do it anytime between the Modify() statement (or however you're
changing the dataobject) and the retrieve.

--
Paul Horan[TeamSybase]


Rony Santoso

unread,
Feb 14, 2005, 5:11:25 AM2/14/05
to
got it... that's where the weird behavior came from...

it also explain why datawindow services enabled before was disabled after a


direct
"dw_1.dataobject = " or with a Modify() or
SetSQLSelect() statement?


TG, it's fixed now.

cheers,
rony


"Rony Santoso" <ron...@yahoo.de> wrote in message news:...


> yes i did, the code was put at ancestor window and failed at descendant
>

> "Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
> news:420e2bc1$1@forums-1-dub...

> > "Rony Santoso" <ron...@yahoo.de> wrote in message

0 new messages