I have a simple table (with < 10 records) on which I do a select:
Code: Select all
SELECT ID, OMSCHRIJVING FROM LOCATIES ORDER BY OMSCHRIJVING
When I delete the first record (not the first record in the table but the first record in the DBGrid which became the first because of the "ORDER BY" clause), I get the exception "EZDatabaseError: Bookmark was not found" (unit ZAbstractRODataset.pas procedure TZAbstractRODataset.InternalGotoBookmark(Bookmark: Pointer) line 2242). The record has been deleted.
Without the "ORDER BY" clause but with the field "OMSCHRIJVING" in the property SortedFields of TZQuery gives the same exception. Also a seperate TZUpdateSQL object connected with the TZQuery with generated SQL gives the same exception.
A record other than the first one is no problem. If I retrieve the records from the table without the "ORDER BY" clause it is also no problem. Also when I make a index in the ClientDataSet.
I've searched the forum an read some issues with the same exception and should be solved.
In the unit ZAbstractDataset.pas indeed the code is fixed, but not in ZAbstractRODataset.pas.
The exception comes from the unit ZAbstractRODataset.pas as if I used a read-only query (TZReadOnlyQuery) but that isn't the case. I know for sure I use a TZQuery.
I get the same exception on another tables with the "ORDER BY" clause.
Has anyone the same problem c.q. a solution other than no "ORDER BY" and a index in the ClientDataSet ?