Following Situation: I have a column containing a boolean value (it´s an integer: zero for false, anything else means true). To display it properly I´ve added a calculated field "_Mark" to the TZReadOnlyQuery. It displays an "X" when column "Mark" is not zero or a blank, when zero.
I display those Values in a DBgrid. OnDoubleClick I want to send an update-SQL (that works already) and then simply update the display with modifying the calculated field, because Closing on Re-opening the Query is too slow. But then I get an error: Dataset not in edit or insert mode. (I get a german message - I hope, I translated correctly.)
With ZEOS 6.1.x it worked.
Calculated Fields cause an error...
Moderators: gto, cipto_kh, EgonHugeist
Hmm... let me understand: You modify a calculated field which value calculation is based on another field. If I understood well, then the problem is already in design of the thing, because:
- You are working with a read-only query.
- How do you know which calculated field has to be calculated and which has been modified?
- Always when modify-ing a query it must be set in dsEdit mode, so the error is quite logical.
- Why not use the .Refresh method - maybe it is faster than clode/open?
Try to not use a read-only query and repeat the thing - maybe it works that way.
- You are working with a read-only query.
- How do you know which calculated field has to be calculated and which has been modified?
- Always when modify-ing a query it must be set in dsEdit mode, so the error is quite logical.
- Why not use the .Refresh method - maybe it is faster than clode/open?
Try to not use a read-only query and repeat the thing - maybe it works that way.