Solved

QTP, issue connecting to Oracle DB

Posted on 2009-07-01
2
1,909 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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Note: You must have administrative privileges in order to configure lead or case queues. Salesforce.com (http://www.Salesforce.com) is a cloud-based customer relationship management (CRM) system. It is widely used around the world by sales and ma…
Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

763 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

11 Experts available now in Live!

Get 1:1 Help Now