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

how u write vb script in qtp pls give me some basic script and some material

32 Answers   Datamatics, UHG, Winit,


What is the use of Regular expression?

5 Answers  


How to check the value for variables during run time. Pls anybody can give the answer.. Thanks in advance...

4 Answers   Navis,


Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?

1 Answers   Crea,


In google i'm going to search something like "rose", i usually get 10 results in the first page and in 2nd page 10 results and in 3rd 10 results so on upto 10th page 10 results. so if i want to open all the 10 pages 10 results i.e., 100 results and close..what is the DP for this? pls can anyone answer my Question..PLZZZZZ...

4 Answers   Indium Software,


Can we create test script with out Step Generator?

4 Answers  


How can I change object description or check point values in qtp?

0 Answers  


write a test script in QTP to test the text that written in an image(i.e jpg)of a web page???

0 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  


what is defenetion of kiran can u tell me plz CVS, SVN

0 Answers  


What are the factors on which script execution time is dependent?

0 Answers  


What is the main difference between QTP 8.0& QTP 9.2.And what r the features and benefits of QTP.

1 Answers   HCL,


Categories