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

I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

679


If the objects hierarchy is changing from build to build, then how you will handle that condition?

710


Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks

1507


What is test object model in quicktest professional?

715


How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?

729






Can any body please tell me the steps of keyword driven framework of QTP.

1651


How to check which add-ins are associated with a test in qtp?

679


I have many listboxes in my application. I have to check whether the contents inside the listboxes are in sorted order or not..can anyone please send the code as early as possible

1550


If I give some thousand tests to execute in two days what do you do?

676


What is throw object?

1829


Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?

1971


What is accessibility check point?

747


In the application that I'm testing is having a WYSIWIYG editor.QTP is recording editor's body as web element. I want to add some data to this web Element at run time. The problem is that I cant find a method to add contents to this web Element. Can any one come up with an answer for this. Thankx.

1538


What is the default object synchronization timeout in qtp?

743


If object is not recognized by qtp but the object is standard object what is your approach?

696