Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

When we use Object Spy? can we write QTP script before built is came in testing?

3 Answers   Impulse,


You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?

0 Answers   CTS,


How to find Total no of Text Fields in the Page..Anybody please answer me..Thanks in Advance

2 Answers   BirlaSoft,


How many ways we can parameterize data in QTP?

1 Answers   Crea,


What is the Command used to start the QTP

0 Answers   HCL,


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

1 Answers   Crea,


How do you learn the object in QTP?

2 Answers  


Which is the best QTP training institute in Delhi/NCR region and what is the approximate fee for QTP course (Basics and Advanced)

0 Answers  


give me descriptive programing code sample flight application in qtp?

8 Answers   CA, IBM,


what is meant by iterative model?What is its working principle?What are its advantages and what are its drawbacks?

2 Answers  


How to handle the exceptions using recovery secnario manager in Qtp?

2 Answers  


list me out the shortcutkeys for some functionlities in the qtp for example to record ,to run ... etc

2 Answers   CTS,


Categories