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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How Can I find the least value in a bunch of variables using qtp.. E.g.:- A = 210, B = 212, C = 60, D = 111 I don’t want to write bunch of lines for this…. Is there a way to get the result in one line…..

1630


how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?

1910


how to explain a claims and insurance project?

1753


QTP script is not working on other's machine..

1541


What are the Test design techniques you uses in ur project?

1489






what is keyword driven testing in qtp?n how is it useful?

1493


When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

1627


Tell me about your project? please help me how to tell about insurance project

1537


Why we load add-ins in qtp?

629


Explain how Does Run time data (Parameterization) is handled in QTP?

559


How to Upgrade or support firefox 2.0 version on QTP 9.0? I have installed QTP 9.0 and installed firefox 2.0. But in REcord and Run Settings, it shows firefox 1.5 in Web tab for browser selection.

1791


how to create flat file datasubmission in qtp

1908


What is checkpoints for qtp?

536


Tell me one scenario, the complex functionality you have automated in your project?

1479


What are some test assets and related extensions of qtp?

557