delphi xe 之路(23)clientdataset的locate函数

简介: <div style="margin:0px; padding:0px; font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px">  <span style="margin:0px; padding:0px; color:rgb(51,51,51); font-family:arial,'courier
  locate主要用于查找数据,但是它的查找速度没有finding和going定位快。下面我举一个例子。
procedure TForm1.LocateBtnClick(Sender: 
TObject);
begin
Start;
if ClientDataSet1.Locate('Field1,Field2..',VarArrayOf['value1,value2..'], []) then
begin
Done;
StatusBar1.Panels[3].Text :=
'Match located at record ' +
IntToStr(ClientDataSet1.RecNo);
end
else
begin
Done;
StatusBar1.Panels[3].Text := 'No match located';
end;
end;

  函数原型为clientdataset 1.locate(const KeyFields: String; const KeyValues: Variant;Options: TLocateOptions): Boolean;
参数 :KeyFields 是查询的字段名;
KeyValues 是查询的条件值;
Options 是查询标准 ,分为 
[ loCaseInsensitive] 不分大小写
[ loPartialKey] 部分字符
[ ] 一模一样

目录
相关文章
[oeasy]python0084_扩展BCD_EBCDIC_ibm的发家史
[oeasy]python0084_扩展BCD_EBCDIC_ibm的发家史
62 0
[oeasy]python0084_扩展BCD_EBCDIC_ibm的发家史
|
关系型数据库 MySQL
delphi xe 之路(27)XE7 Datasnap使用dbExpress连接MySQL
<p style="margin-top:14px; margin-bottom:14px; padding-top:0px; padding-bottom:0px; word-break:normal; word-wrap:break-word; font-size:16px; line-height:28px; font-family:simsun; text-indent:2em;
3714 0
delphi XE7 数组操作中缺少的find(POS)功能
delphi xe7 中对数组操作做了很多扩充,比如加入了类似字符串处理的功能。 例如,数组相加 var A: array of integer; B: TBytes = [1,2,3,4]; //Initialization can be done from declaration begin .
813 0
|
Java Android开发 UED
delphi xe 之路(30)Delphi XE7 update1进步太大了
<span style="background-color:rgb(255,255,255)"><span style="color:rgb(64,64,64); font-family:'Microsoft YaHei','Helvetica Neue',SimSun; font-size:14px; line-height:21px">1.更新的bug列表并不全</span><br s
2571 0
delphi xe之路(16)ini文件的操作
<span style="font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px">filecreate('路径加文件名');//创建一个文件。 </span><br style="font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-heigh
2728 0
|
安全 Windows
Delphi XE之路(7)Mobile MessageDlg函数
<div style="margin:0px; padding:0px; font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px"> <span style="margin:0px; padding:0px; color:rgb(50,62,50); font-family:simsun">在用XE5创建
2704 0
|
数据库 索引
delphi xe 之路(20)clientdataset的详细介绍02
<div style="margin:0px; padding:0px; font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px"> <span style="margin:0px; padding:0px; color:rgb(12,12,12); font-family:simsun">ClientD
2397 0