I was analyzing the rxdbgrid code and I found a trouble at this line:
DHS.RecNo := Min(DHL.RecordCount + SavePos - 1, DHS.RecNo);
I don't know why but, when the Min value returns 0 the error occurs. So I tried change the parameters but I felt a little insecure about it, then I thought add an if clause like this:
if Min(DHL.RecordCount + SavePos - 1, DHS.RecNo) > 0 then
DHS.RecNo := Min(DHL.RecordCount + SavePos - 1, DHS.RecNo);
Anyway, I think that is necessary to find the root cause of this error.
Seya