Got a ClientDataSet with a single MAX(field) aggregate. I append a record and apply updates and everything is fine. When I then close the dataset, I get an exception: "Operation not applicable".

Got a ClientDataSet with a single MAX(field) aggregate. I append a record and apply updates and everything is fine. When I then close the dataset, I get an exception: "Operation not applicable".

It crashes when it tries to drop the aggregate, and if I put "cds.Aggregates.Clear" in the OnBeforeClose, the error goes away. Setting the aggregate's Active := False does not help.

Neither the clientdataset, provider nor query has any other event handlers doing funny stuff. I'm using DBX btw.

Anyone got the slightest clue as to what's going on here?

I've got several other data modules with clientdatasets having a similar aggregate and I've never stumbled upon this before.

Comments

  1. FWIW it crashes in TCustomClientDataSet.CloseAggs, on the line "Check(FDSCursor.DropAggregate(FAggregates[I].AggHandle));"

    ReplyDelete

Post a Comment