12-11-2013, 11:20 AM
I am using the following function in QTP 11 to fetch data from Oracle in Windows XP 32-bit machine:
The above code gets executed without any error.
However, I am getting the following error on executing the same script in Windows7 64-bit machine while fetching data from Oracle:
ORA-06413: Connection not open
Can somebody help with the exact steps that would be required. I have tried several options after searching the internet, but none worked so far.
Code:
strConn = "DRIVER={Microsoft ODBC for Oracle};UID=******;PWD=******;SERVER=******;"
strQuery = "select * from ref_enterprise"
Public Function ADODB_DBConnection(strConn, strQuery)
Dim conn, rs
Set conn = CreateObject("ADODB.Connection")
With conn
.ConnectionString = strConn
.Open
Set rs = CreateObject("ADODB.Recordset")
rs.Open strQuery, conn, 3, 3
End With
ADODB_DBConnection = Array(rs.RecordCount, rs, rs.Fields.Count, conn)
Set conn = Nothing
Set rs = Nothing
End Function
Data = ADODB_DBConnection(strConn, strQuery)
msgbox Data(0)
msgbox Data(1).Fields(0).Value
The above code gets executed without any error.
However, I am getting the following error on executing the same script in Windows7 64-bit machine while fetching data from Oracle:
ORA-06413: Connection not open
Can somebody help with the exact steps that would be required. I have tried several options after searching the internet, but none worked so far.