how do u retrieve data from a database ? i.e. i want to
retrieve 2nd record only from a database ? write code for
this. by using ADODB connecton, RSOBJ and using a FOR loop
we can retrieve all the records( ex: if we give query as
select * from emp). but i want only 2nd record. so how to
acheive this.

Answers were Sorted based on User's Feedback



how do u retrieve data from a database ? i.e. i want to retrieve 2nd record only from a database ..

Answer / praveen

set dbobj=createobject("adodb.connection")
dbobj.provider="Microsoft.jet.oledb.4.0"
dbobj.open "<path of .mdb(msaccess)file>"

set rsobj=createobject("adodb.recordset")
QRY=select * from emp" 'for example
rsobj.open QRY,dbobj

for i=1 to 2
rec=rsobj.getrows(3,0) 'retrieve 3 records starting from 0
rec1=rec(0,i)
next

Is This Answer Correct ?    0 Yes 0 No

how do u retrieve data from a database ? i.e. i want to retrieve 2nd record only from a database ..

Answer / cheryl

I think you need to set your for loop so that it reads only
2 records or as many records from the record set that you
want. i.e for i = 1 to 2

read the next record
next

this way you have the 2nd record

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

if full in Object Repostoiory then how to load other Object Repository

2 Answers  


How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?

0 Answers  


Where we write the FUNCTIONS, in Expert view (or) in any textfiles like Notepad and save it in Library functions folder? How to cal that functions to our script? How to save that functions to Function generator?

3 Answers  


Can we Script any test case with out having Object repository? or Using Object Repository is a must

3 Answers   Crea,


how u test a frame in a web page using QTP?

1 Answers   Accenture, IBM,






Explain quicktest professional (qtp) testing process?

0 Answers  


Hi, can explain the draw back of manual testing.plz send me the answer to my mail id deepthip1985@gmail.com

0 Answers  


how do pass parameters from one action to another action

2 Answers  


In an output value text checkpoint, where does the output value stored by default ?

4 Answers   Ordain Solutions,


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

0 Answers  


what is the difference between Reusable action and external action?

2 Answers   HCL,


hai,i want to select an option from the right click pop up menu.but the qtp is not recognizing the right click pop up menu as a seperate object.can any one tell me the solution.

4 Answers   HP,


Categories