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

How to test login module with different username and password by using data driven testing in QTP?

0 Answers   HCL,


How to change the run-time value of a property for an object?

3 Answers   Crea,


How did you resolve conflicts present in Object Repository?

0 Answers  


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

1 Answers   Crea,


what is the test process followed for your project?

1 Answers   ADP, Satyam,






Why do you choose only QTP for your project automation among remaining tools like Rational robot and silk test?

2 Answers   CTS,


what are the utilities and drivers

0 Answers   Cap Gemini,


key word driven frame work is like a folder structure Question is that where is the folder like funtion library folder,object repository,data base,application scenerio folder etc are store whether in a remote machine where we have to access or in our machine (it just like VSS)

0 Answers   Kanbay,


what is the automation framework that ur company using(actual procedure,not theoritically explination)

1 Answers  


Do we get any issues if we run the testscript on different browsers? what are the options we need to st in QTP?

2 Answers   BirlaSoft,


Explain about the test fusion report of quicktest professional (qtp)?

0 Answers  


what is exact difference between smoke and sanity testing?

6 Answers   Satyam,


Categories