New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
4751 views

Prerequisites for getting connected to Oracle DB 11g using QTP

Hi All,

I want to get connected to Oracle DB 11g using QTP 11.0 to read some data.Can you please let me know what things I need to have installed on my PC from drivers and DB point of view?

I have QTP 11.0 on my pc and nothing else....drivers or oracle client are NOT installed on my PC at this moment.

  • Do I need to install Oracle Database client on the PC where I want to run QTP script?
  • Do I need install ODBC Driver or OLEDB driver for Oracle on the PC where I want to run QTP script?
  • Or only one of the above is fine?
  • In order to use Microsoft ODBC for Oracle ….do I need to install SQL Drivers also on the pc?
  • Etc


So, I am confused what exactly needs to be installed on the PC...please guide me.

Thanks,
Anil

Tags (1)
0 Likes
1 Reply
Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

1. Download ODBC driver from oracle website. (http://www.oracle.com/technetwork/database/windows/downloads/index-096177.html)

2.  Use below snippet to connect and retrieving records from a table.

 

Set conn = Createobject("ADODB.Connection")

strCon = "Driver={Microsoft ODBC for Oracle}; " & _
    "CONNECTSTRING=(DESCRIPTION=" & _
    "(ADDRESS=(PROTOCOL=TCP)" & _
    "(HOST=" & <Host> & ")(PORT=" & <port>& "))" & _
    "(CONNECT_DATA=(SERVICE_NAME=" & <serviceName>& "))); uid=" & <userid>& ";pwd=" & <password> & ";"

conn.Open strCon

 

strQuery = "Select * from cat"

 

Set recordSetObj = Createobject("ADODB.recordset")

Set recordSetObj= conn.Execute(strQuery)

 

While Not recordSetObj.EOF

 recordSetObj.fields("columnName")

 recordSetObj.MoveNext

Wend

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.