How to Import the data from MS-Access in QTP?



How to Import the data from MS-Access in QTP?..

Answer / arunsingh

I will give you the example for retrieving the OrdrNo from
database using msAcess:

systemutil.Run "C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
Dialog("text:=Login").Activate
Dialog("text:=Login").WinEdit("attached text:=Agent
Name:").set "rajaputra"
Dialog("text:=Login").WinEdit("attached
text:=Password:").set "mercury"
Dialog("text:=Login").WinButton("text:=OK").click
Window("text:=Flight Reservation").Activate
For i=1 to 5
Window("text:=Flight Reservation").WinButton("window
id:=5").click
Dialog("text:=Open Order").Activate
Dialog("text:=Open Order").WinCheckBox("text:=&Order
No.").set "ON"

''''Till this you know. this is DP for getting the details
'''''of the order no. Now to get the order no from
'''''datatabase using MSACSESS follow the navigations

'Goto insert-output value-Database Out put value
'Select first radio button, and select check box maximum no
'of rows (say 5)-Next
'Select MSAcess Database,select C:\Program Files-Mercury
'Interactive-QuickTest
'Professional-samples-flight-app-flight32 database
'select Orders-Order No-Next-next-next-Finish
'click on the double click on order no one by one then Ok
'You will get ''DbTable("DbTable").Output
'CheckPoint("DbTable")''''' Line

a=datatable(i,1)
'msgbox a
Dialog("text:=Open Order").WinEdit("window id:=1016").set a
Dialog("text:=Open Order").WinButton("text:=OK").click
Pname=Window("text:=Flight Reservation").WinEdit("attached
text:=Name:","window id:=1014").GetVisibleText
msgbox "The Passenger Name of Order No "&a&" is "& Pname
Next


''''Run the program''''

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More QTP Interview Questions

Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks

0 Answers  


How does QTP identify an object?

0 Answers  


For example one window is there the window contain some of Check boxes but my question is how many check boxes are there particular window? Please solve the problem gi_raju@rediffmail.com ippaliraju@yahoo.co.in

3 Answers  


is the institute MindQ laid by Mr.Nageswar rao.. heard alot about Nageswar rao...can you briefly let me know about the Nageswar rao inst. and MinQ...THANX IN ADVANCE

44 Answers   InterGraph,


What is the condition or scenario that leads the use of object spy in qtp? (while recording we can get all the properties) then wat leads to use this?

2 Answers   iSoft,






what are the 5 types of objects in qtp

6 Answers   ABC, TCS, Wipro,


If you use low level recording,what objects will be recorded in Object Repository and what properties?

3 Answers   CTS,


How will u declare a variable to access multiple actions? a)Dim b)Global c)Public d)Private

1 Answers  


can anyone please send me qtp framework material please its urgent

1 Answers  


How can i open 5 multiple browser at once through QTP VB script

4 Answers  


how to identify an object which is not in the object repository identification can be done using descriptive programming.

2 Answers  


Test cases for Traffic Signals

4 Answers   AppLabs,


Categories