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. |
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 ...
|
|||||||
|
|||
|
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 |
| Sponsored Links |
|
|||
|
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 |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |