Hola, Mi problema es el siguiente, necesito desde Visual Basic 6.0 conectarme via ADO a una base de datos Oracle 9i.
Para tal motivo utilizo el siguiente codigo:
Global RsConsulta As New ADODB.Recordset
Global RsConexion As New ADODB.Connection
Global conODBC As Variant
Sub carga_ini()
On Error GoTo error
'DEFINICION DE PARAMETROS DE CONEXION
Archivo_Ini = App.Path & "\config.ini"
DNS = LeeINI(Archivo_Ini, "Conexion", "DNS")
USR = LeeINI(Archivo_Ini, "Conexion", "USR")
PWD = LeeINI(Archivo_Ini, "Conexion", "PWD")
SRV = LeeINI(Archivo_Ini, "Conexion", "SRV")
LOG = LeeINI(Archivo_Ini, "Conexion", "LOG")
OPC = LeeINI(Archivo_Ini, "Conexion", "OPC")
' CONEXION POR ADO A ORACLE
If OPC = 0 Then
Set Conexion_ORACLE = New ADODB.Connection
With Conexion_ORACLE
.Provider = "MSDAORA.1"
.Properties("Data Source") = " & DNS & "
.Properties("User Id") = " & USR & "
.Properties("Password") = " & PWD & "
.Properties("Persist Security Info") = True
.Open
End With
pero me saca el siguiente error: Error de Oracle, no se pudo recuperar el mensaje.
Else
' CONEXION POR ODBC A ORACLE
conODBC = "DSN=" + DNS + ";ODBC;uid=" + USR + ";pwd=" + PWD
RsConexion.CursorLocation = adUseClient
RsConexion.Open conODBC
End If
Ahora bien, via ODBC hago la conexion y funciona:
error:
If Err <> 0 Then MsgBox Err.Description
End
End Sub
El requerimiento es que debe ser via ADO.
Los controladores que tengo para dicho fin en mi maquina son:
Microsoft ODBC for Oracle 2.575.1132.00 (MSORCL32.DLL)
Oracle en Oracle9 9.02.00.00 (SQORA32.DLL)
Agradezco su ayuda lo mas pronto posible ya que el Microsoft Project me esta castigando por esto y todos sabemos como es eso.
Gracias