5

I have a problem with TClientDataSet. On the DataSet, the order by clause of my SQL works fine, but when I use a TClientDataSet, the records appear in order of the database's id field.

What am I doing wrong?

0

1 Answer 1

10

Your problem is in the TDataSetProvider, not in the TClientDataSet itself.

Try setting the poRetainServerOrder flag to True in the TDataSetProvider.Options property:

Signals that the client should not attempt to re-establish the default order by sorting the records in the data packet. This prevents the client from changing the record order because, for example, it is unable to duplicate the locale on the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.