03-01-2010, 08:50 PM
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
' 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
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