BDE表排序

发布于 2024-09-06 01:19:04 字数 35 浏览 2 评论 0原文

我正在使用 BDE.... 如何按给定字段对表进行排序?

Im using BDE....
How can i sort a table by given field?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纵情客 2024-09-13 01:19:04

因此,首先我的假设是您正在使用 TTable 组件。

简单的方法...

使用 TQuery 组件而不是 TTable 组件,并让数据库通过 order by 子句为您完成繁重的工作。

困难的方法....

您可以使用 DbiSortTable 函数(在 DbiProcs.int 文件中声明),您可以在 google 上搜索一些示例代码。

现在,说了这么多,如果您有机会,您应该考虑从 BDE 迁移出去,它已被弃用,并且 Delphi 有更好的数据库连接机制可用,Embarcadero 会推荐 DBEXpress 作为更好的选择。

So, firstly my assumtion is you are using a TTable component.

Easy way...

Use a TQuery component instead of a TTable component and let the database do the heavy lifting for you with a order by clause.

Hard way....

you can use the DbiSortTable function (declared in the DbiProcs.int file) you can google that for some sample code.

Now, having said all of that, if you have the opportunity, you should think about migrating away from the BDE, it's deprecated and there are vastly better database connectivity mechanisms available for Delphi, Embarcadero would recommend DBEXpress as a better way to go.

人生戏 2024-09-13 01:19:04

不熟悉 BDE - 但如果它支持标准 SQL,order by FIELD_NAME 应该可以正常工作。

Not familiar with BDE - but if it supports standard SQL the order by FIELD_NAME should work fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文