Micro Focus QTP (UFT) Forums
How to read expected row from MsAccess table in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to read expected row from MsAccess table in QTP (/Thread-How-to-read-expected-row-from-MsAccess-table-in-QTP)



How to read expected row from MsAccess table in QTP - dineshb - 12-11-2009

Hi,
Is there any way to get the expected row data of MsAccess Table?
Eg. I want ot read 4th record of MsAcces table ABC.tbl

In WinRunner we use
db_get_row ( session_name, row_index, row_content );

Thanks in advance.
Dinesh


RE: How to read expected row from MsAccess table in QTP - dineshb - 12-15-2009

Hi,
The solution is as below.
Code:
set con = CreateObject("ADODB.Connection")       'Create MsAccess object
set rs =CreateObject("ADODB.recordset")               ' record set
con.provider = "microsoft.jet.oledb.4.0"
Sql = "Select City from Address"  'consider 5 records in table Address
rs.open Sql,con
' moves the control to 2nd record/row by following statement
rs.move(2)


Thanks
Dinesh


RE: How to read expected row from MsAccess table in QTP - dineshb - 12-15-2009

Hi,

One correction :
Please read comment as
' moves the control to 3rd record/row by following statement. The 0 is first record.


Note: I have found this solution by R&D.

Sorry for the trouble.

Thanks
Dinesh