Handle multiple rows in recordset for ms access db.

45 views
Skip to first unread message

Vishal

unread,
Jul 10, 2014, 1:57:54 AM7/10/14
to mercu...@googlegroups.com
Hi,

Can anyone suggest me that how we can handle multiple rows in recordset?

Currently I am getting multiple rows as a query result and get value from each row one by one. how to do that?

I am using MS Access db as a data source.

Awaiting for help.

Thanks,
Vishal

Prasad.L.V

unread,
Jul 10, 2014, 11:24:03 AM7/10/14
to mercu...@googlegroups.com
are you trying to read the value from db output?


--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

udayanem

unread,
Jul 13, 2014, 5:31:32 AM7/13/14
to mercu...@googlegroups.com
Hi Vishal,

Try below code:

Dim conOb
Set conObj=createobject("ADODB.Connection")
conObj.open "driver=XXXXXX;" etc...
'You can find the right connection stings for the DB at this location:
http://www.connectionstrings.com/

Set ResultSet=conObj.Execute("select * from YourTableName")

While not ResultSet.EOF
    stdname=ResultSet("your filed name")
    'stdname=ResultSet("your filed name").value   //both the statement yield the same results
    print stdname
    msgbox(stdname)
    ResultSet.movenext
Wend

Please let me know if the above doent help.

Thanks,
Uday
QTP / UFT Videos

Vishal

unread,
Jul 15, 2014, 1:33:54 AM7/15/14
to mercu...@googlegroups.com
We are connecting db using connection string method. so it wont help me.

Vikas Gmal

unread,
Jul 15, 2014, 5:26:28 AM7/15/14
to mercu...@googlegroups.com
Hi vishal,

Try this <RecordsetName>.MoveNext

Sent from my iPhone

Vikas Gmal

unread,
Jul 15, 2014, 5:29:09 AM7/15/14
to mercu...@googlegroups.com
Hi vishal,

Try this 

<RecordsetName>.MoveNext
<RecordsetName>.MoveFirst
<RecordsetName>.MoveLast

Vikas

On 15-Jul-2014, at 11:03 am, Vishal <vishal...@gmail.com> wrote:

Vishal Shah

unread,
Jul 15, 2014, 6:47:04 AM7/15/14
to mercu...@googlegroups.com
Hi,

I have resolved it.

Thanks for your help..Really appreciate it. :)




You received this message because you are subscribed to a topic in the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mercuryqtp/nDxLty7uoQU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mercuryqtp+...@googlegroups.com.

shekhar bhakat

unread,
Jul 16, 2014, 3:42:23 AM7/16/14
to mercu...@googlegroups.com
Hi Vishal,

You can try the following code in order to get the value from MS DB access,

Set oDb=CreateObject("ADODB.CONNECTION")
oDb.open"Provide=.....;Data Source=........"

oData=oDb.Execute(Query)

Fields=oData.fields.count

For i=0 to Fields-1
     Do until oData.EOF
        FieldValue=oData.field(i).value
        msgbox FieldValue
        oData.Movenext
    Loop

oData.MoveFirst

Next

Please let me know if you need any further information regarding this.

Akhalesh Yadav

unread,
Jul 16, 2014, 11:03:51 AM7/16/14
to mercu...@googlegroups.com
Try this....
    While not myRecord.EOF
       LName=myRecord.Fields("Name")
    myRecord.moveNext
   Wend
 myRecord.close


Thanks..
Akhalesh


On Tue, Jul 15, 2014 at 11:03 AM, Vishal <vishal...@gmail.com> wrote:



--
Akhalesh yadav
+919555717928
+919310680659
Reply all
Reply to author
Forward
0 new messages