Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database query
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi All,
i have a query which gives 3 rows.
"Selct home from temp where name ='ajay'"
it returns 3 rows with different data "A1","B1","C1"
i want to store these values got from 3 rows into 3 variables.

i have database connection done in qtp.
-- should i use a FOR loop with count
-- record set

pleae help with the code .

Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Ajay,

Please see the following code.
'objRst is your record set object.
' strRep is an array

Code:
i= 0
While Not objRst.EOF
    strRep(i) = objRst("Home").Value
             i= i+1
    objRst.MoveNext
Wend
Please let me know if you have any queries.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
thnaks a lot rajeshwar/
are u from bangalore ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Rolleyes Browse object query Hema a newbie 0 1,808 07-22-2014, 08:37 PM
Last Post: Hema a newbie
  SQL Query Issue in QTP rajiv.qtp 1 2,486 11-28-2013, 10:36 AM
Last Post: Jay
  Do recordsets get to use only ONE query? Arena 0 2,192 04-03-2012, 07:08 PM
Last Post: Arena
  Pass "/" in Query string to DB Anjali09 0 2,585 01-04-2012, 08:34 PM
Last Post: Anjali09
  mapping database user to database kamalteja 4 4,710 11-03-2010, 11:58 AM
Last Post: kamalteja

Forum Jump:


Users browsing this thread: 1 Guest(s)