how we connect oracle or sql data server database to qtp.
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

Answers were Sorted based on User's Feedback



how we connect oracle or sql data server database to qtp. Hi Ram I was your answer for this. Can yo..

Answer / snig

http://funandknowledge.blogspot.com/2008/03/qt.html

Is This Answer Correct ?    0 Yes 0 No

how we connect oracle or sql data server database to qtp. Hi Ram I was your answer for this. Can yo..

Answer / gms

'Declaration for SQL
Dim objConnection,objRecordset,count1

'Connecting to the database
Set objConnection = CreateObject("ADODB.Connection")

objConnection.Open "Driver={SQL Server};" & "Server=YOUR
SQL SERVER NAME;" & "Database= DB NAME;" & "UID=USERID;"
& "PWD=DB PASSWORD;"

'Running the query
sql1 = "GIVE UR QUERY HERE"
'Create record set for the query
Set objRecordset = CreateObject("ADODB.Recordset")
objRecordset.Open sql1, objConnection

As this is a Back-End process, you cannot view the result
set. so you can place the result in the datatable using the
following steps:


'Retrieving data from the database to the data table
count1 =1
While Not objRecordset.EOF
datatable.SetcurrentRow (count1)
Datatable("C",1)= objRecordset("nbr").value
objRecordset.movenext
count1 = count1+1
wend

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More QTP Interview Questions

What are Add-ins availble in licensed version QTP8.2

1 Answers   TCS,


i am trying to automate yatra.com,in that site, when i go to automate the Leaving from field showing as a WEBEDIT, but when i enter 1 or 2 char, it displaying dropdownlist, i try to use keyboard automation to select the item from that list but it is not possible, can anybody help he. Thans for posting the Answer

0 Answers   TCS,


what is error and fault in terms of software quality?

0 Answers   TCS,


difference between do while and do until ?

3 Answers   HCL,


How to call Datable values in the QTP program. exp: I have two parameters like Email id and Password this two i would like to add multiple entries in the datable to use it. What is the difference between Gobal/Action datatable

3 Answers  






What is iteration? How it is related to Test Results in QTP

3 Answers   Virinchi Technologies,


what is the extension for the test version of the script?

5 Answers   TCS,


How do I modify a value of an elemnt which is not the first one in xml file? My sample XML file is like: <Environment> <Variable> <Name>Name</Name> <Value>Uday Kumar</Value> </Variable> <Variable> <Name>Designation</Name> <Value>Senior Software Engineer</Value> </Variable> </Environment> for example, I'd like to change the value 'Senior Software Engineer' to 'Student' in the second element. How do I do it in QTP?

3 Answers   QualiTest,


Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script

18 Answers   IBM,


Hi every body, I am new to QTP.pls help me if anybody knows the solution. Here is my doubt: I have 3 excel sheets in my local drive out of which one is password protected and i want to get the data of all these xL's either by importing or by reading the data finally i have to update this data in the website.(and the site is secured site) I tried by importing all XL"s one by one but couldn't do so. plss send me the code or atleast suggest me the approach. Thanks in Advance Padmaja

3 Answers   Symphony,


what is the difference between action and function

11 Answers   AppLabs, BirlaSoft, Infosys,


How good are you in writing VBscript code for your application? Can you completely write VBscrit for your project with out using recording mode in QTP?

3 Answers   CTS,


Categories