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
images are dynamically changes how to compare two images with out using the bitmap
To which environments does quicktest professional supports?
Are Shared ORs read-only?
What are the types of object repositories? Which one is you using?
How to record a qtp script ?
how to create flat file datasubmission in qtp
What are some test assets and related extensions of qtp?
what is run action?
Which scripting language used by quicktest professional (qtp)?
I want to read XML file loaded in Quality center and compare the values with the values displayed in Application (web table).How can I do that
How to handle the exceptions using recovery secnario manager in quicktest professional?
HOw to add the recovery file at runtime to the test file .
How many number of actions possible in qtp?
What is the purpose of loading qtp add-ins?
What are the check points can be inserted without recording?