Micro Focus QTP (UFT) Forums
problem with reading records from DB2 table - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: problem with reading records from DB2 table (/Thread-problem-with-reading-records-from-DB2-table)



problem with reading records from DB2 table - sqadri - 06-22-2012

Could someone please help me with this issue. I am trying to read all the data in all the columns of a table and the script leaves out some records, e.g. if I have 100 rows only 95 are read. Is theer a limit as how many records can be read.

Code:
DB2Cn.Open DB2ConnStr
Set getDB2Connect = DB2Cn
If getDB2Connect.Errors.Count = 0 Then
Set rs = DB2Cn.Execute(query,,adExecuteNoRecords)
colCount= rs.fields.count  ' to retrieve the no. of columns in recordset
rows = rs.fields(0).value 'rs.recordcount

Then I am using a for loop to get each row data.

Thanks,
Sqadri


RE: problem with reading records from DB2 table - supputuri - 06-22-2012

try using

Do while not rs.EOF

loop




RE: problem with reading records from DB2 table - sqadri - 06-23-2012

Thank your response, sorry I was wrong I am not using for loop but I am using while loop

Code:
'While rs.EOF <> True
             'For n=0 To colCount-1
'                If strcomp( rs.fields(n).value, "")>0Then
'                     Print rs.fields(n).value
'                End If
             'Next
            'Print rs.fields(0).value
            'rs.MoveNext
        'wend

Thanks,
Sqadri