How to handle exception when data table is not available in
local host system or path is not correct(explain statement
with example)



How to handle exception when data table is not available in local host system or path is not corre..

Answer / shyam prasad

Dim Dsn_conn,rs

Set objConnection=Createobject("ADODB.Connection")
Dsn_conn= "DSN=QT_Flight32;DBQ=C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight32.mdb;Driver=C:\WINNT
\system32\odbcjt32.dll;DriverId=281;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;"
objConnection.Open(Dsn_conn)
Set rs=CreateObject("ADODB.RecordSet")


Set rs=objconnection.execute(" select flight_Number from
Flights where flight_Number>20330") (Instead of this
statement search the table u will get it
)


rs.MoveFirst

While Not rs.EOF
Msgbox rs.fields.item("flight_Number")
rs.movenext
Wend

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

what is the defference between QTP 8.2 and 9.0and 9.2? plz tell me

6 Answers  


Hi..All I have installed QTP 10.0, and need to Automate SAP Application.....so i need to Install SAP Add-ins, anybady has SAP-Addins, Please help me, and thanks in advanced plese send it on my email id: sandipgami84@gmail.com Thanks, Sandip Gami +91-9714177088

1 Answers  


when we open flight reservation.at that time where we found synchronization point() and wait function().i m confused .i want this answer.

1 Answers  


How can we record an edit box in the Web application ?

4 Answers   Kanbay,


when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks

0 Answers  






If we write a script in the expert view how are the objects created in the object repository? to be clear i will explain my problem first i have recorded the mercurytours application by providing the link www.mercurytours.com and all the objects are stored in the object repository ok this is fine. but i have copied the script generated in the above processes and pasted in a new test and tried to run that script but as the objects were not stored in the object repository it showed an error (The "Welcome: Mercury Tours" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object).so how can i overcome that error

6 Answers  


In real time ,How to run all scripts in QTP? i,e in projects

3 Answers  


I have recorded a test over web application(with IE6.0) in analog mode. But, while running it my test gets failed. Why? (Note: my systray has 3 open web applications)

1 Answers  


Write a QTP script to print all the link names displayed in a web page

4 Answers   TCS, Virtusa,


Why we have to import data from excel sheet to data table?becoz v can directly use test data directly from xl know. can u all pls explain me clearly

1 Answers  


Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?

0 Answers   ADP, CTS,


How to load an object to a object repository at RUN TIME ?

3 Answers  


Categories