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!

connecting in two database at same time with the same structures

Status
Not open for further replies.

paul102384

Programmer
Oct 5, 2007
30
hi to all pb programmers:

Is it possible to connect 2 database (particularly an mssql db) at same time in powerbuilder? if yes, can somebody tell me how to do this thanks...
 
you can use two different transaction objects. Normally you'll allready have one by default: 'sqlca'.

For the other one do:

transaction tr_2

tr_2 = create transaction
tr_2.dmbs = '.....' ( 'ODBC' for example)
tr_2.logid = .....
tr_2.logpass = ....
tr_2.dbparm = .....

connect using tr_2;
if tr_2.sqlcode <> 0 then
// connection error
end if

// you simply use it as you would connect and use sqlca, the only difference will be to specify 'using tr_2' when you use embedded sql or when you do a:
dw_1.settransobject( tr_2)



regards,
Miguel L.
 
thanks miguelleeuwe for your post i really appreciate..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top