Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connecting to oracle DB with QTP
#2
Solved: 10 Years, 9 Months, 3 Weeks ago
Hi Rajendra,

Try the following code and let me know how it goes:

Code:
Dim strConn
strConn = "Driver= {Microsoft ODBC for Oracle}; " &_
                  "ConnectString=(DESCRIPTION=" &_
                  "(ADDRESS=(PROTOCOL=TCP)" &_
                  "(HOST=host name) (PORT=port no))" &_
                  "(CONNECT_DATA=(SERVICE_NAME=service name)));uid=user id; pwd=password;"

Dim obConnect
Dim obRecset

Set obConnect =CreateObject("ADODB.Connection")
Set obRecset = CreateObject("ADODB.Recordset")

obConnect.Open strConn

Dim queryStr
queryStr = "select * from TABLE" // your query

Set obRecset = obConnect.Execute(queryStr)

obRecset.MoveFirst

GetDBField = obRecset.Fields(0).Value

Replace host name, port, service name, uid and password with your original values.
Reply


Messages In This Thread
Connecting to oracle DB with QTP - by rajendra649 - 12-07-2011, 02:38 PM
RE: Connecting to oracle DB with QTP - by PrabhatN - 12-07-2011, 05:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP 11 - Oracle Forms objects not recognised WarrenRay 0 3,003 06-23-2015, 09:35 PM
Last Post: WarrenRay
  QTP recognizing Oracle forms as Java objects shankar.srini88 0 4,404 03-25-2014, 10:26 AM
Last Post: shankar.srini88
  Connecting to database Irishman 0 4,329 07-24-2012, 11:30 PM
Last Post: Irishman
  Unable to record Oracle Forms apps and Oracle java based apps dejanbo 0 3,343 06-19-2012, 08:05 PM
Last Post: dejanbo
Exclamation QTP 11 - Object properties are lost after execution of script for Oracle Forms 11 ramapullareddy 0 2,771 12-07-2011, 04:15 PM
Last Post: ramapullareddy

Forum Jump:


Users browsing this thread: 1 Guest(s)