Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

how we connect oracle or sql data server database to qtp.

Answers were Sorted based on User's Feedback

how we connect oracle or sql data server database to qtp...

Answer / ram

open qtp-->click record

In Insert Menu-->OutputValue-->Database Output value--
>select specify query manually radio button-->and click at
create button->click new-->select sqlserver from the popup
and click next-->next

u will get connection
st Professional;WSID=computername;

and write sqlstatement

select columnid from tablename (dont put * instead of

then automatically the below line is added in qtp
DbTable("DbTable").Output CheckPoint("DbTable")
and do remaining stuff.

u need some more clarification please send the mail to

Is This Answer Correct ?    10 Yes 8 No

how we connect oracle or sql data server database to qtp...

Answer / mohit

You may try:

Dim rs,sq,pkey
set conn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")
' Oracle client is required to be installed on your box "Provider=OraOLEDB.Oracle.1;Password=***;Persist
Security Info=True;User ID=****;SERVER=****;Data
sql="your sql" sql,conn

set rs=nothing

set conn=nothing

Is This Answer Correct ?    7 Yes 6 No

how we connect oracle or sql data server database to qtp...

Answer / deepu

Hi Ram I was your answer for this. Can you kindly let me
know in details steps on How we can connect to database. i
am using QTP9.2 and SQL Server Database. I am new for QTP
and this would be of great help.Thanks

Is This Answer Correct ?    2 Yes 4 No

how we connect oracle or sql data server database to qtp...

Answer / kiran kumar gunda

Kiran Kumar Gunda Mail ID:


'Create the ADO object
Set dbconn = CreateObject("ADODB.Connection") 'connecting
to database by opening the connection string & executing
Set recset = CreateObject("ADODB.Recordset") '
Insert,delete, update..for DML statements
SQLQuery="select * from sym_pduser.branch_information"
'Set the DSN Name

'Environment.Value("DSB_DSN")="CHRD_DEV1 =(DESCRIPTION =
= chrd0)))"
dbconn.Open Environment.Value("DSB_DSN")
recset.CursorType = 1
' "select * from
' ""&SQLQuery,dbconn

msgbox "Database Connection Successful"

msgbox RecCount

Set RecCount=Nothing
Set recset =Nothing
Set dbconn=Nothing

Creation of DSN String
1) Place the tnsnames.ora file in the
D:\oracle\product\10.1.0\db_1\NETWORK\ADMIN folder
2) Add the Data Source name in the in the System DSN
Go to Control panel -> Administrative Tools ->
Data Sources -> System DSN -> Add
a. Select a Driver for which you want to setup a data
source – Oracle 10g
b. Enter Data source name : CHORD_TEST2
c. Description : Chordiant_Test2
d. Select TNS service name, enter User ID
Password: userld0
3) Create a .Udl file and select – select a Provider
Microsoft OLE DB provider for Oracle(Provider for ODBC
Click on UDL file and select Connection -> Select use
connection string radio button, click on Build
a) Select machine Data Source
b) Select previously created Data source i.e.,
c) Enter password, Your Connection string will be
Below is the generated DSN String

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

Hi All, I need 5 yrs exp manual and automation testing using QTP sample resume. is there any body having please send me my mail id is Tahnks in Advance

0 Answers  

The string is like POWER STAR PAVAN , write a script for this how to findout the number of "A" in the string ?

7 Answers   TCS,

How does QTP identify an object?

0 Answers  

hi.what is exactly mean by real time frame work? every institute teach Framework is nothing but having 6 to 7 folders..and save repositories functions keywords and scripts? this is enough or not? can we beleive?

1 Answers  

How to send the qtp results file by email (Lotus notes).

1 Answers   TCS,

How exactly you start scripting in QTP? In the interview he was not satisfied with my answer.Please post what is correct answer.

5 Answers  

What are the types of object repositories? Which one is you using?

0 Answers  

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456

10 Answers   Oracle,

How can get count of list box?

0 Answers  

what are the cases in which we use XML and accessibility check points.

2 Answers  

how to reverse a string with out using string or predefined function,ex:string is " i love india". the output should be like this "i evol aidni"

10 Answers   Aspire, MNC, Omega,

I have below user Defained function function AddTwo(ByVal a, ByVal b) Dim Ans Ans=a+b MsgBox Ans End function Now my question comes here...from given below methods which method is right to call above function?Which is Wrong and why? 1. AddTwo(2,4) 2. Call AddTwo(2,4) 3. AddTwo 2,4 4. Call AddTwo 2,4

1 Answers