Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MDB result to compare against QTP Output
#1
Solved: 10 Years, 8 Months, 4 Weeks ago Exclamation 
Hi, i am pretty much new to QTP .. and even VbScripting .. can you help me on the below!

The below code only retrieves the first value in the first row, In what way can i retrieve data in sequence (one row after the other) from a table, in access database and compare against an output value ( from a Webedit object on the GUI ) for different employees.

Here is a sample of the code

Code:
dim objDB
dim objRS
dim intCounter

' create a database and recordset objects
Set objDB = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.RecordSet")

' configure the connection
objDB.Provider="Microsoft.Jet.OLEDB.4.0"
objDB.Open "c:\MyTestDatabase.mdb"

' count the number of records in the employee table
objRS.Open "SELECT emp from Employee" , objDB

' HOW DO I loop and GET DATA IN A SEQUENCE ONE AFTER THE OTHER AND COMPARE AGAINST MY OUTPUT VALUE IN QTP

' destroy the objects
Set objDB = Nothing
Set objRS = Nothing
Reply
#2
Solved: 10 Years, 8 Months, 4 Weeks ago
try below to loop through your recordset
Code:
objRS.MoveFirst
While Not objRS.EOF
    Val = objRS.Fields("emp")
    objRS.MoveNext
Wend

Reply
#3
Solved: 10 Years, 8 Months, 4 Weeks ago
Thanks Saket.. Can you tell me .. how to use it in the above code

.. i think, i am doing something wrong.
Reply
#4
Solved: 10 Years, 8 Months, 4 Weeks ago
append these lines to your code, before setting objects to nothing.
try and let me know how it goes.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  table output values shipu 1 2,243 01-24-2014, 10:06 AM
Last Post: supputuri
  Compare 2 image files in Beyond Compare through QTP arpan 0 3,803 10-16-2013, 02:39 AM
Last Post: arpan
  MDB database Fresher88 0 1,874 09-04-2012, 11:26 PM
Last Post: Fresher88
  Output is different from two different machines for the same block of code in QTP. bdash_10 0 1,962 04-13-2012, 03:38 PM
Last Post: bdash_10
  QTP file compare - ignoring file structure Fede 3 5,019 02-17-2012, 02:48 AM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)