Hi a have problem with reading/writing ODBC files. It seems that there is no problem with the connection but the agent that holds the following codes reads only 4 records from the end of the ODBC file, although it supposed to read hundreds. I deleted the last 10 records from the ODBC file to see if there is something wrong with the data but the result was the same: only the last 4 records was read again.
The agent is something like this:
table=“SALES”
qry.SQL = "SELECT * FROM " & table
result.execute
Result.CacheLimit=DB_NONE
If result.IsResultSetAvailable Then
dbffields=con.ListFields(table)
i=0
If result.GetValue(“NOTES”)=“” Then
Do
i=i+1
Set doc=db.createdocument
doc.form="JelF"
...
Call doc.Save(True, False)
Call result.setValue("NOTES", "1")
result.UpdateRow
result.NextRow
Loop Until result.IsEndOfData
Msgbox "Reading from BOF is finished."
Exit Sub
Elseif result.GetValue(“NOTES”)=“1” Then
result.LastRow
Do
i=i+1
Set doc=db.createdocument
doc.form="JelF"
...
Call doc.Save(True, False)
Call result.setValue("NOTES", "1")
result.UpdateRow
result.PrevRow
Loop Until result.GetValue("NOTES")="1"
End If
Msgbox Str(i)+" records read."
result.Close(DB_CLOSE)
con.Disconnect
Thank you for your help.
Etyien