Micro Focus QTP (UFT) Forums
Database query - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Database query (/Thread-Database-query)



Database query - ajayr1982 - 12-30-2010

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 .




RE: Database query - rajeshwar - 12-30-2010

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.


RE: Database query - ajayr1982 - 12-31-2010

thnaks a lot rajeshwar/
are u from bangalore ?