结果集排序问题。急...........................

chengangcsdn 2005-06-23 04:43:25
我使用clientdataset在前台构成一个结果集。
但我现在想按照某一字段倒序排序。

我知道可以用IndexFieldNames属性设置索引字段。
但这样是升序排序。

急。。。。。。。怎么实现倒序排序啊。

注:用的是clientdataset控件,不要叫我换控件啊。
结果集是在前台通过很多运算构成的,不要叫我在SQL语中用ORDER BY 语句哈!
...全文
103 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdyyr 2005-06-24
  • 打赏
  • 举报
回复
ixDescending The index imposes a descending sort order. (Not applicable to all table types.)
-----------------
ixDescending 此索引指定倒序排序.(不是對所有的表類型都適用.)
chengangcsdn 2005-06-23
  • 打赏
  • 举报
回复
但小弟英文实在太差。楼上老大能否解释一下下面各个参数的涵义。
Value Description

ixPrimary The index is the primary index of the table. (Not applicable to dBASE tables).
ixUnique Each value in the index is unique; there are no duplicates. (Not applicable to all table types.)
ixDescending The index imposes a descending sort order. (Not applicable to all table types.)
ixExpression The index is based on a dBASE key expression. (Only applicable to dBASE tables).
ixCaseInsensitive The index sorts records case insensitively. (Not applicable to all table types.)

ixNonMaintained The index is not automatically updated when the data is edited. (Not applicable to all table types.)

Warning: Attempting to create an index using options that are not applicable to the table type causes AddIndex to raise an exception.

See the vendor-supplied documentation for the particular database system for details on what index options are applicable.
chengangcsdn 2005-06-23
  • 打赏
  • 举报
回复
收到!
Erice 2005-06-23
  • 打赏
  • 举报
回复
升序
procedure TForm1.IndexAec(DataSets:TClientdataset;FieldName: String);
begin
DataSets.IndexName:='';
DataSets.IndexDefs.Update;
DataSets.AddIndex(FieldName,FieldName,[ixCaseInsensitive],'',FieldName,0);
DataSets.IndexName:=FieldName;
DataSets.IndexDefs.Update;
end;
chengangcsdn 2005-06-23
  • 打赏
  • 举报
回复
up!
怎么没有人回答啊。

2,507

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧