12-07-2011, 02:38 PM
(This post was last modified: 12-07-2011, 02:38 PM by rajendra649.)
Hi All,
In my application i want to connect oracle database to QTP .I tried with below code but failed to establish connection. For this, I have created data source name by following steps :
Control Panel...>Administrative Tools...>Data Sources (ODBC) ...>select system DSN...>
Click on Add...>Select Driver “Microsoft ODBC For Oracle” Database
And C:\oracle_10.2.0_client_1 software has been installed in my machine. I have tried many ways even I am getting following errors with respective to the following codes:
Case1:
Case2:
Error Message: ORA-12560: TNS:protocol adapter error
Case3:
Error message: ORA-12154: TNS:could not resolve the connect identifier specified
please help me to resolve this problem
Thanks and Regards
Raju
In my application i want to connect oracle database to QTP .I tried with below code but failed to establish connection. For this, I have created data source name by following steps :
Control Panel...>Administrative Tools...>Data Sources (ODBC) ...>select system DSN...>
Click on Add...>Select Driver “Microsoft ODBC For Oracle” Database
And C:\oracle_10.2.0_client_1 software has been installed in my machine. I have tried many ways even I am getting following errors with respective to the following codes:
Case1:
Code:
set strcon=createobject("ADODB.Connection")
set Recordset=createobject("ADODB.Recordset")
strcon.Open "Provider=OraOLEDB.Oracle"
strcon.Open "DRIVER={Microsoft ODBC for Oracle};UID=username;PWD=password;SERVER=servername;DBQ=DBQname;"
Error message: Provider cannot be found. It may not be properly installed.
Line (5): "strcon.Open "Provider=OraOLEDB.Oracle"".
Code:
set strcon=createobject("ADODB.Connection")
set Recordset=createobject("ADODB.Recordset")
strcon.Open "Provider=msdaora;DRIVER=Microsoft ODBC for Oracle;User Id=username;Password=password;SERVER=servername;"
Error Message: ORA-12560: TNS:protocol adapter error
Case3:
Code:
set strcon=createobject("ADODB.Connection")
set Recordset=createobject("ADODB.Recordset")
strcon.Open "Provider=msdaora;Data Source=MyOracleDB;User Id=username;Password=password;SERVER=servername;"
please help me to resolve this problem
Thanks and Regards
Raju