Solved

QTP, issue connecting to Oracle DB

Posted on 2009-07-01
2
1,922 Views
Last Modified: 2013-12-19
I am running below mentioned function in QTP ,
I get error "Provider cannot be found. It may not be properly installed.".Though I have installed oracle client on my machine(Oracle Runtime(213MB)).
Can please some one suggest whats missing.


Function:
Function Get_Id
      
            
      Dim objConn
      Dim objRecordset
      Dim strSQL

      Set objConn = CreateObject("ADODB.Connection")
      Set objRecordset = CreateObject("ADODB.Recordset")


  objConnectOracleReuse.ConnectionString = "Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(CID=GTU_APP)"  & _
               "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myHostName)(PORT=port)))" & _
               "(CONNECT_DATA=(SID=sid)(SERVER=DEDICATED))); User Id=userId; Password=pwswrd;"

  strSQL = "SELECT MAX(COLUMN_NAME) AS VALUE FROM TABLE_NAME"
      

      objConn.Open
      objRecordset.Open strSQL,objConn
      
      Dim obj
      obj =  objRecordset.fields.item("VALUE")

      Msgbox obj
      objRecordset.Close
      objConn.Close

      Set objConn = Nothing
      Set objRecordset = Nothing

End Function
0
Comment
Question by:Kumaran_1
2 Comments
 
LVL 47

Accepted Solution

by:
schwertner earned 500 total points
ID: 24756677
myHostName
should be the name of the computer where Oracle Instance reside

port
should be 1521

sid
should be the name of the Oracle instance

Where are these values assigned?
0
 

Author Closing Comment

by:Kumaran_1
ID: 31598864
I already have this information, hostName, sid, port.Didn't add to this post.Some issue exist in oracle client installation.nOT SURE WHAT IT IS.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now