Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple database connection

Status
Not open for further replies.

beti

Programmer
Oct 6, 2002
26
US
Hi,

Can anyone please tell me how to connect to muliple database. Right now I am connecting to a single database using ini.file.

Thanks & Regards
 
create multiple database profiles in ur ini file
example:
[profile1]
...
....

[profile2]
...
...

and create local transaction objects ltr_profile1,ltr_profile2....



hope this helps
 
Try PowerScript similar to this:

////////////////////////////////////////////
transaction ltr_Prod, ltr_Test
//////////////////////////////
// Connect to the Prod dB
ltr_Prod = CREATE transaction
//
ltr_Prod.DBMS = ...
ltr_Prod.LogID = ...
ltr_Prod.LogPass = ...
ltr_Prod.ServerName = ...
//
CONNECT USING ltr_Prod ;
dw_Prod.SetTransObject( ltr_Prod )
//
//////////////////////////
// Connect to the Test dB
ltr_Test = CREATE transaction
//
ltr_Test.DBMS = ...
ltr_Test.LogID = ...
ltr_Test.LogPass = ...
ltr_Test.ServerName = ...
//
CONNECT USING ltr_Test ;
dw_Test.SetTransObject( ltr_Test )

////////////////////////////////////////////

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
Subscribe: PowerObject-subscribe@YahooGroups.com
 
I appreciate all the suggestions here , but as per my understanding it says about how to define multiple databases in INI profile file or scripts etc. But in reality it connect to only one database at a single point of time depending on the arguments/values that you passed.

Please correct me if I'm wrong .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top