Unified Functional Testing Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

Highlighted
Visitor

Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

I was recently assigned a new desktop machine [Windows 7 x64] and took this as an opportunity to upgrade from QTP 11.0 to UFT 11.5.  I have common database connection code that I use to connect to several different RDBMs, and after switching to UFT 11.5, this code no longer works for oracle connections within UFT.   I have confirmed that the same code works fine for DB2 and SQLServer connections (when used with the appropriate connection strings).

 

I have installed the Oracle 11g 32-bit ODAC, and the exact same code works just fine when I run it using the 32-bit version of cscript from the command line.  It only fails when the script is being executed by UFT.

 

I have tried reinstalling the oracle driver, reinstalling UFT, granting full permissions for all users on the oracle_home folder, and I can't seem to get the oracle driver to work within UFT.

 

The code uses a TNS-less connection string (example below), but I even tried setting up a 32-bit system DSN and connecting using that.  I get the same results (works from CMD line, fails in UFT).

 

strConnString = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" &_
				strServer & ")(PORT=" & strPort & ")))(CONNECT_DATA=(SID=" & strDataSource & ")(SERVER=DEDICATED)));User Id=" &_
				strUserId & ";Password=" & strPassword

Here are the error details:

 

ERROR: Error Occurred!
Number (dec) : -2147467259
Number (hex) : 80004005
Description : Specified driver could not be loaded due to system error 1114: A dynamic link library (DLL) initialization routine failed. (Oracle in OraClient11g_home32, c:\oracle\product\11.2.0\client_32\SQORA32.DLL).
Source : Microsoft OLE DB Provider for ODBC Drivers

 

Note:  The oracle_home path shown above is correct, and I have granted all permissions to the oracle_home folder.

 

Here is my code (though I think this is more of a setup/config issue):

 

'*********
'** Author:      Jason Self
'** Date:        30 March 2012
'** Description: Connect to a database using a connection string
'**
'** Parameters:
'**   strConnectionString - Connection String used to identify the DB
'**   						Samples: http://www.connectionstrings.com/
'**
'** Returns: Object - the database connection object
'*********
Public Function ConnectToDatabase(strConnectionString)

	Dim objConn
	
	'Create ADO objects
	Set objConn = CreateObject("ADODB.Connection")

	objConn.Open strConnectionString
	
	Set ConnectToDatabase = objConn
	
End Function


'*********
'** Author:      Jason Self
'** Date:        30 March 2012
'** Description: Check a database connection
'**
'** Parameters:
'**   strConnectionString - Connection String used to identify the DB
'**   						Samples: http://www.connectionstrings.com/
'**
'** Returns: Boolean - Whether or not the connection was successful
'*********
Public Function CheckDBConnection(strConnectionString)

	On Error Resume Next
	ConnectToDatabase strConnectionString
	If Err.Number <> 0 Then
		DisplayCustomError "Error Occurred!"
		CheckDBConnection = False
	Else
		CheckDBConnection = True
	End If

	Err.clear
	
End Function

 

Has anyone else seen this issue?  Any ideas for how I can get around it?

 

Thanks!

 

7 REPLIES
Established Member

Re: Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

I've had a similar problem using the MS for Oracle ODBC driver that comes with Windows 7. I installed the latest Oracle Drivers for my 11g DB and then used http://www.connectionstrings.com/oracle-provider-for-ole-db-oraoledb/standard-security/ instead. Be sure to get the latest. I had an earlier version of the Oracle drivers and still had a problem untill I installed the latest version.

Visitor

Re: Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

Thanks for the reply.  I finally got it to work with the following procedure:

 

  1. I uninstalled all oracle drivers I had installed previously
  2. Rebooted my machine
  3. Downloaded the 64-bit and 32-bit Oracle 12c client install packages– look for the section near the bottom labeled Oracle Database 12c Release 1 Client (12.1.0.1.0) for Microsoft Windows (x64 and 32-bit)
  4. Installed 64-bit client first [installed to C:\oracle\product\12.1.0\client_64]
  5. Rebooted my machine [Note:  I tried installing the 32-bit version immediately afterward, but I got a weird installer error.  It worked fine after the reboot.]
  6. Installed 32-bit client [installed to C:\oracle\product\12.1.0\client_32]
  7. Rebooted again (because Windows)

I don't know what the magic sauce was here - maybe installing the full client instead of just the ODAC package did the trick.

Advisor

Re: Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

Can you please provide the connection string you are using?  Thanks!

Visitor

Re: Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

The connection string format is shown in the original post.  Here it is again, though...

 

Sample:

 

Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=port)))(CONNECT_DATA=(SID=sid)(SERVER=DEDICATED)));User Id=user;Password=password

 

Code:

 

strConnString = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(" &_ 
"ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & strServer &_
")(PORT=" & strPort & ")))(CONNECT_DATA=(SID=" &_
strDataSource & ")(SERVER=DEDICATED)));User Id=" &_
strUserId & ";Password=" & strPassword
Visitor

Re: Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

Hallo,

I get the same error ( 1114: eine DLL-Initialisierung ....) and try the procedure you describe to install oracle new, but it doesn't help.

 

I have another configuration

 

Win8.1 32-bit

HP UFT 12.02

Oracle client 12.1.

 

I become a connection, an see the tables. The error occurs when the query is executed. The path is correct and the file sqora32.dll exist.

 

Perhaps someone could help me ?

Thanks

GaFi

Occasional Visitor

Re: Unable to connect to Oracle databases using ADO within UFT 12.05

Hi All,

 

Please help me to connect the UFT with Oracle Database. 

 

This is my code.

 

Dim objCon,objRs
Set objCon = CreateObject("adodb.connection")
Set objRs = CreateObject("adodb.recordset")

'objCon.Open "Provider=MSDAORA;Data Source=192.168.148.11,1521;Database=ACHWCERT;User Id=ACH_USER;Password=ACH_USER;"
'objCon.Open "Driver={Microsoft ODBC for Oracle};Server=ACHWCERT;Uid=ACH_USER;Pwd=ACH_USER;"

'objCon.Open "Provider=OraOLEDB.Oracle;Data Source=192.168.148.11,1521;Database=ACHWCERT;User Id=ACH_USER;Password=ACH_USER;"
If objCon.State=1 Then
     Reporter.ReportEvent micPass,"Database Connection Established successfully","Done"
 Else
     Reporter.ReportEvent micFail,"Database Connection failed","Failed"
 End If

 

 

I have tried above three connection string, but i am facing error as "Provider cannot be found. It may not be properly installed".

Using Oracle SQL developer.

 

I dont know which provider i need to install. Please kindly help me.

Occasional Visitor

Re: Unable to connect to Oracle databases using ADO within UFT 11.5 [Error 80004005]

Try creating an enivronment variable named ORACLE_HOME and set it value to the instantclient folder location, like "C:\Oracle\instantclient_12_1"