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

Can launch two instances of qtp on the same machine?

774


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

2197


can any body give the banking domain concepts/links

3839


Tell me about qtp?

709


Explain the concept of object repository and how quicktest professional recognises objects?

770


Is QTP supports Unix. If yes, then how the test automation is done?

1955


How can you pass value one action to another action?

767


How to handle dynamic objects in quicktest professional?

719


What is an optional step in qtp ?

850


Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

3628


How you are developing the script? Using record and play back or manual?

802


Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

3000


What is the use of text output value in quicktest professional?

714


Any body have QTP 9.5 licence key. please provide me at madhukar_dec30@yahoo.co.in

1784


How many add-ins comes by default with qtp?

805