Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

QTP connectivity with MS-Access

This is a discussion on QTP connectivity with MS-Access within the QTP forums, part of the Software Testing category; I have made a connection to Access database from QTP using ADODB connection,,,, and also declared a recordset for it....There are 2 rows in the database and i want to ...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 04-17-2009
Junior Member
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
nehakalra is on a distinguished road
QTP connectivity with MS-Access

I have made a connection to Access database from QTP using ADODB connection,,,,
and also declared a recordset for it....There are 2 rows in the database and
i want to fetch the values from all the rows...But the problem is that when
all rows are fetched , QTP runs the whole script and again starts for the
first line of the QTP code for the second iteration....and in this process
it again opens the same connection and fetches the same rows again.....
Can anyone tell me how to fetch the values from next of database in the next iteration....
I shall be thankful if anyone can provide me the code for the same ...tx.
I have written following code-
set con = CreateObject("ADODB.Connection")
set rs =CreateObject("ADODB.recordset")
con.provider = "microsoft.jet.oledb.4.0"
con.open "C:\MyFlightDataBase.mdb"
rs.open "select*from flight1",con
row=1
do While not rs.EOF
datatable.SetCurrentRow(row)
datatable.Value (1,1)=rs.fields("FlyFrom")
datatable.Value(2,1)=rs.fields("FlyTo")
datatable.Value(3,1)=rs.fields("Name")
row=row +1
rs.movenext
loop
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-20-2009
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 208
Thanks: 3
Thanked 19 Times in 19 Posts
NawabShaikh is on a distinguished road
Re: QTP connectivity with MS-Access

you are using the Global Sheet..thats resulting in Script Parametrization..

Please use datatable.Value (1,2)

Regards,
Nawab
Reply With Quote
  #3 (permalink)  
Old 04-20-2009
Junior Member
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
nehakalra is on a distinguished road
Re: QTP connectivity with MS-Access

Hi Nawab,

Will you please elaborate your reply.

Thanx for help
Reply With Quote
  #4 (permalink)  
Old 04-20-2009
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 208
Thanks: 3
Thanked 19 Times in 19 Posts
NawabShaikh is on a distinguished road
Re: QTP connectivity with MS-Access

if you check QTP documentation, it specify that global sheet will parametrize the entire script. Hence in your case when ever the data is loaded in Global Sheet i.e datatable("", 1) the script execute the entire code for that row.

now in your case its a DB fetch, hence the script is going in an infinite loop, as your script is fetching certain records and putting them up in Datatable.
(if this portion is not clear please do revert).

hence u are facing unexpected iteration in the execution.

Regards,
Nawab
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
database connectivity anver SQL Server 2 06-13-2008 06:13 AM
db connectivity rajshekhar.das C# 3 03-24-2008 02:18 PM
Mainframe connectivity Onkar Sehgal QTP 1 01-19-2008 09:59 PM
About cpp connectivity govindaraj123 Mathematical Puzzles 5 08-06-2007 03:11 AM
Access Boss is a great access management and time control utility that allows you to JobHelper Geeks Lounge 0 07-22-2007 05:40 AM


All times are GMT -4. The time now is 02:55 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved