我使用clientdataset在前台构成一个结果集。
但我现在想按照某一字段倒序排序。我知道可以用IndexFieldNames属性设置索引字段。
但这样是升序排序。急。怎么实现倒序排序啊。注:用的是clientdataset控件,不要叫我换控件啊。
结果集是在前台通过很多运算构成的,不要叫我在SQL语中用ORDER BY 语句哈!
但我现在想按照某一字段倒序排序。我知道可以用IndexFieldNames属性设置索引字段。
但这样是升序排序。急。怎么实现倒序排序啊。注:用的是clientdataset控件,不要叫我换控件啊。
结果集是在前台通过很多运算构成的,不要叫我在SQL语中用ORDER BY 语句哈!
解决方案 »
- delphi备份access以后找不到备份的文件是怎么回事
- 今天早上发现可用分多了50多万分,拼命散了一些,但什么时候才能散完?
- 请问:如何让用delphi开发的exe程序可以与一个网站通过xml方式进行数据交换?
- 进,100分!
- 一个关于TActionManager和TActionToolBar的问题!
- 请高手留几句 delphi 调用divx压解视频流的例子的代码.
- 谁有跨国集团的企业总体开发设计方案?-------(我的不知道可不可行可以帮我看看吗?)
- 请问:对String类型的字符串在指定位置插入一个字串的函数是什么?
- API 函数WSAWaitForMultipleEvents在哪个.PAS文件中声明
- Delphi中,如何调用WINAPI函数!
- 任意给出4个数字,要求将他们按不同的顺序排列组合,将组合的结果列出来,怎么写?
- intraweb中如何得到上传文件的大小?
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;
Value DescriptionixPrimary 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.
-----------------
ixDescending 此索引指定倒序排序.(不是對所有的表類型都適用.)