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
What are the recording modes in wave event?
Key word driven framework
How you can find length of array in qtp?
What is difference between Recording time object identification and Run time (Execution) time.
How to open a new test using quicktest professional?
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
What is synchronization? What are the ways you can synchronize?
What is the difference between run time object and test object?
Discuss quicktest professional (qtp) environment?
what is the hierarchy to use properties in descriptive programming
What is clean sweep?
Explain about datafile/verification of date file when file is not available in local system?
How will you check a web application for broken links using qtp?
What is the syntax to call one script from another?
Explain the check points in quicktest professional?