Hi Paul,
This is the first time I did it, so it may not be the best way... but it works!
I added some comments below that may help you ...
>>> "Klebe, Paul E." <[EMAIL PROTECTED]> 11/03/99 03:12PM >>>
My name is Paul Klebe, I work for the North Dakota Public Service
Commission. I have an upcoming project where I will be attempting to
connect to two different databases. Would you be willing to talk to me
about doing this. I am not getting where you are getting the connection
to two different databases.
-----Original Message-----
From: Jill M. Claus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 03, 1999 1:39 PM
To: [EMAIL PROTECTED]
Subject: RE: PFCSIG: Connecting to Two Databases
I got it working - thanks everyone!
For anyone curious, I changed the n_tr instance variable to be global
and edited the application manager pfc_open event code to be:
// enable transaction registration (the registration service is need when using more
than one database)
gnv_app.of_SetTrRegistration(TRUE)
// register SQLCA (the connection to the first database which was connect to the usual
way)
gnv_app.inv_trregistration.of_Register(SQLCA)
// connect to and register ABRN_MRS database (the second database)
// create the second transaction object - note that you must have "n_tr gtr_amrs"
identified as a global variable
gtr_amrs = CREATE n_tr
// copy connection info from the first database called SQLCA to the second database
called gtr_amrs - it copies the user id, password, database name, server name, etc.
from the definition of the first database connection to the definition of the second
database connection
il_return = SQLCA.of_CopyTo(gtr_amrs)
// re-assign the database name to the second definition
gtr_amrs.Database = "your_2nd_database_name"
// re-assign the server name to the second definition - if it's different
gtr_amrs.ServerName = "your_2nd_server_name"
// connect to the second database
ll_return = gtr_amrs.of_Connect()
If ll_return <> 0 then MessageBox("Error", "Unable to connect.")
// register the second database with the registration service
gnv_app.inv_trregistration.of_Register(gtr_amrs)
Then when ever you want to retrive data from the 2nd database, you would say... (in
the window's open event)
li_return = dw_1.of_SetTransObject(gtr_amrs)
dw_1.retrieve()
instead of...
li_return = dw_1.of_SetTransObject(SQLCA)
dw_1.retrieve()
Hope this helps!
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]