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 compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
what is Property......End Property loop? how to write sript for it in QTP
Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance
hi frinds i need help .i have 4 + yrs exp in testing and nearly 2 yrs exp in QTP and QC .currently iam working north fast 2 yrs iam looking for job in south is there any openings plz letme know my mail id is pbre1980@gmail.com
How to execute a winrunner script in quicktest professional (qtp)?
How to find the difference between 2 dates in qtp?
Get the count of files of similar types from a folder.
What is Curd testing?
What is file database?
How do you check ticket cost and ticket number in flight application?
what is the difference between development and testing
I have enrolled for a QTP course which is a four weekend course.Do you think its a good way to start off learning this tool?What all do i need with me in order to become a pro at using this tool?
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?
After fixing the bug, the same bug is raising again and again in new builds what we have to do? That bug is high level bug.
Functions call by reference and call by value. i want the diff b/n these 2 and how will be the script for this?in which situation we use these 2..?pls explain me clearly