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
Answer Posted / 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 View All Answers
How to record application running on the Virtual machine?
can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com
Can any one send me the QTP Basic Coding Samples?
What is quicktest professional (qtp)?
What is debugging? How you debug your script?
What is the difference between run time object and test object?
How would you directly trigger javascript in a test?
HI, pls help me on this, iam not able to capture getcelldata value in javatable... msgbox javawindow("").javatable("").getcelldata(3,3) but it diaplays empty...
what is key word driven frame work ? why it is called like that ? what is the diference between keyword driven and data driven frame work ?
Hi Friends... By using QTP , can we test .net products...and that product supports different languages.. thanx in advance..
Discuss quicktest professional environment?
action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans
Call to copy of an action and call to existing action… i know the diff but in real project how to use..? i want live scenario.pls help me..
Can we run test with out adding object in object repository? How it is possible?
How can you pass value one action to another action?