Hi everyone,I am trying to rewrite my old application’s Lotus Script code using LSXLC instead of LSXODBC. In the old one I had a chance to know if I am on the last row in a resultset using resultset.IsEndOfData property. The LSXLC doesn’t have such property (or I could not find it). Does anyone know how can I figure out if I am on the last row of the returned record set?
I use ODBC2 connector to SQL Server and it does not return the number of records returned by stored procedure for some reason, so I can’t calculate my last record.
I managed to work around this problem.If someone is interested I did the following:
Dim lastRow as Integer
Dim fldList As LCFieldList
Dim fldListCurr As LCFieldList
Dim fetchedCount as Integer
'con is an opened connection object
lastRow = False
fetchedCount = con.Fetch (fldLst) 'get first row
While (fetchedCount > 0)
Set fldListCurr = fldLst.Copy ' fldListCurr keeps current row for processing
fetchedCount = con.Fetch (fldLst) ' get next row
If fetchedCount = 0 Then
lastRow = True
End If
'Process fldListCurr and lastRow if needed
'...
The While/Wend loop executes until you get to the last row. The ‘if fetchedCount = 0’ is, therefor, redundant since it’s only 0 outside of the While/wend loop.
Is there something you need to do when the count is > 0 but it’s the last row?
If you haven’t yet, be sure to post this over in the Enterprise forum - that’s the place for LCLSX stuff.
I think you’ll find it’s part of the Fetch method. The line below starts a while loop that continues until the ldresultfieldlist is empty, ie end of data.
Thanks Doug for the response. I will try to search that forum. As for the Fetch method: it returns just a part of a result set at a time, so I never know how many left there.