Is it possible to have two open Oracle db connections in Excel VBA?
I need to create a query with tables joined from two different servers. I've tried to create two connections like below:
Can't find anything on this online so thinking I have to go another route??![]()
Dim strCNN As String Dim strCNN2 As String Dim cnn As New ADODB.Connection Dim cnn2 As New ADODB Connection strCNN = "Provider=MSDAORA.1" strCNN = strCNN & ";Password=password" strCNN = strCNN & ";User ID=rpt_user" strCNN = strCNN & ";Data Source=abc1" strCNN = strCNN & ";Persist Security Info=True" strCNN2 = "Provider=MSDAORA.1" strCNN2 = strCNN2 & ";Password=password" strCNN2 = strCNN2 & ";User ID=rpt_user" strCNN2 = strCNN2 & ";Data Source=def1" strCNN2 = strCNN2 & ";Persist Security Info=True" With cnn .ConnectionString = strCNN .Open End With With cnn .ConnectionString = strCNN2 .Open End With rst.Open strSQL, cnn, adOpenStatic, adLockReadOnly
Thanks,
Toni











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks