delphi - ClientDataSet 上的 Order by 不起作用

标签 delphi sql-order-by delphi-xe2

我在使用 TClientDataSet 时遇到问题。在 DataSet 上,我的 SQL 的 order by 子句工作正常,但是当我使用 TClientDataSet 时,记录按数据库的顺序显示id 字段。

我做错了什么?

最佳答案

您的问题在 TDataSetProvider ,不在 TClientDataSet 中本身。

尝试设置poRetainServerOrder TDataSetProvider.Options 中标记为 True属性:

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.

关于delphi - ClientDataSet 上的 Order by 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49566781/

相关文章:

windows - 处理 Windows 命令中的扩展字符?

delphi - Delphi 中创建自身实例的类函数

delphi - 在 Delphi TStack<T> 中循环并搜索值

mysql - 加入/排序运行缓慢

sql-server - 正确排序 SQL Server 中存储为字符的点数字

delphi - 如何在 Firemonkey stringgrid 单元格中使用不同的字体样式和图标

delphi - SQLite 库可以嵌入(链接)到 Delphi 可执行文件吗?

MySQL 按前一行 ID 的多列排序

delphi - 为什么向 exe 添加大量资源会很慢并且有时会损坏 exe?

delphi - Val 不适用于 UInt64?