문제

I have an unsorted dataset (a TMSQuery from Devart) that I cannot sort using ORDER BY because I manipulate the records after opening the query so the order given by "ORDER BY" is lost.

I don't want to rewrite the whole logic so I should find a way to sort a dataset.

I can Assign the dataset to a TMemDataSet (TMemDataSet is a DevArt class) descendant (TVirtualTable from Devart), but after this how do I sort (I need to sort by a date field)?

I read this question but it doesn't relly contain the answer I am looking for.

도움이 되었습니까?

해결책

Using IndexFieldNames I solved the problem, it was what I waslooking for. Directly from the TMSQuery component:

MSQuery1.IndexFieldNames := 'EXECUTION_DATE'; //this does the job
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top