I'll take a stab at this...

>>But then I got an error saying that it couldn't assign dw_1 to the type
u_dw<<
Sounds like dw_1 is not of type u_dw.  High probability is it is of type
DataWindow.  In other words, the PFC is causing the error message because it
is trying to register your datawindow control with a PFC service by
assigning a reference to it to a variable of type u_dw.  Won't work because
datawindow <> u_dw.

When using the PFC make sure all datawindow controls on your windows are
instantiated from the u_dw user object and not the datawindow PB visual
object.

>>So I tried making the n_tr variables global.<<
Sounds like you solved your "doesn't recognize the variable." problem, but
then ran into the above.  My guess is the two are unrelated.  Progressive
sequentially -- but not related.

You can "Export" your problem windows and change everything that looks like
"from datawindow" to "from u_dw".  Don't forget to "Import" them back...

Lester LaForce
Consultant, COMSYS
U.S. Army, Personnel Information Systems Directorate
Washington DC area

-----Original Message-----
From: Jill M. Claus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 03, 1999 11:40 AM
To: [EMAIL PROTECTED]
Subject: PFCSIG: Connecting to Two Databases


I am using PowerBuilder 6.5 with Syabase 11 on an NT workstation.

I would like to make an application connect to two different databases.  I
put the following script in  the pfc_open event of the application manager
object:

// enable transaction registration
gnv_app.of_SetTrRegistration(TRUE)
// register SQLCA
gnv_app.inv_trregistration.of_Register(SQLCA)

// connect to and register ABRN_MRS database
itr_amrs = CREATE n_tr
il_return = SQLCA.of_CopyTo(itr_amrs)
itr_amrs.Database = "ABRN_MRS"
itr_amrs.ServerName = "MTPLZAFINQ3"
ll_return = itr_amrs.of_Connect()
If ll_return <> 0 then
        MessageBox("Connection Error", "Unable to connect to ABRN_MRS
database.")
End if
gnv_app.inv_trregistration.of_Register(itr_amrs)
itr_atm.of_SetName("AMRS")


------------------------------------------------

The above code isn't producing any errors, so I think it is working.  

My question is....   When I open a datawindow, how do I make it use the
ABRN_MRS database?

Instead of saying ...
li_return = dw_1.of_SetTransObject(SQLCA)

I tried...

li_return = dw_1.of_SetTransObject(itr_amrs)

and

li_return = dw_1.of_SetTransObject(AMRS)

In both cases, I got an message saying it doesn't recognize the variable.
So I tried making the n_tr variables global.  But then I got an error saying
that it couldn't assign dw_1 to the type u_dw.  

Does anyone know what am I doing wrong?
 
Any help would be greatly appreciated,
Thanks, Jill

> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS,
ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE:   help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]
> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE:   help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]

Reply via email to