RE:Como conectar 2 bases de datos
Hola Ivan, haz lo siguiente
1) defines los objetos de conexion
Public cnOracle As ADODB.Connection
Public cnAccess As ADODB.Connection
2)Crea funcion de conexion al Oracle
Function startConnection_ORACLE() As Boolean
Dim adoErr As Error
Dim xServicio As String
Dim userName As String, userPassword As String
Dim xCnn As String
xServicio = GetSetting(App.Title, "SettingsProvider", "Servicio")
userName = GetSetting(App.Title, "SettingsProvider", "Usuario")
userPassword = GetSetting(App.Title, "SettingsProvider", "Password")
Set cnOracle = New ADODB.Connection
'Establece la Conexion
'Provider=MSDAORA;Data Source=serverName;User ID=userName; Password=userPassword;"
xCnn = "Data Source=" & xServicio & ";User ID=" & userName & "; Password=" & userPassword & ";"
With cnOracle
.Provider = "MSDAORA"
.ConnectionString = xCnn
.Open
End With
End Function
3)Crea funcion de conexion al Access
Function startConnection_ACCESS() As Boolean
Dim adoErr As Error
Dim strPath As String
Dim strDataBase As String
Set cnAccess = New ADODB.Connection
'Establece la Conexion
strPath = GetSetting(App.Title, "SettingsProvider", "Path")
strDataBase = "BaseDatos.mdb"
With cnAccess
.Provider = "Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strPath _
& strDataBase & ";" _