博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Searching for Data
阅读量:6922 次
发布时间:2019-06-27

本文共 1186 字,大约阅读时间需要 3 分钟。

Locate

    AdoTable1.Locate('Name','Zoom',[]);

    var ffield, fvalue: string;

           opts : TLocateOptions;

    ffield := 'Name';

    fvalue := 'zoom';

    opts := [loCaseInsensitive]; 

    if not AdoTable1.Locate(ffield, fvalue, opts) then 

       ShowMessage(fvalue + ' not found in ' + ffield);

 

Lookup

Lookup does not move the cursor to the matching row, it only returns values from it.

var LookupRes: Variant;

LookupRes := ADOTable1.Lookup ('Name', 'Zoom', 'Author; Description');

 if not VarIsNull(LookupRes) then

ShowMessage(VarToStr(LookupRes[0])) //author name

Seek

The ADO datasets Seek method uses an index when performing a search.

You cannot use the Seek method on TADOQuery component.

  function Seek(const KeyValues: Variant; SeekOption: TSeekOption = soFirstEQ): Boolean;

  TSeekOption:   soFirstEQ,soLastEQ,soAfterEQ,soAfter,soBeforeEQ,soBefore

 

var strIndex: string;

strIndex := ComboBox1.Text; //from the code above

 

if ADOTable1.Supports(coSeek) the begin

  with ADOTable1 do begin

Close;

IndexName := strIndex;

CursorLocation := clUseServer;

Open;

Seek (Edit1.Text, soFirstEQ);

 end;

 if ADOTable1.EOF then

ShowMessage ('Record value NOT found');

 end

转载于:https://www.cnblogs.com/xxd0825/archive/2012/12/13/2816987.html

你可能感兴趣的文章
Images.xcassets 的简单使用
查看>>
PHP控制连接打印机
查看>>
Tomcat中的backlog参数
查看>>
Ubuntu · Docker —— 从入门到实践
查看>>
浅析MySQL中的Index Condition Pushdown (ICP 索引条件下推)和Multi-Range Read(MRR 索引多范围查找)查询优化...
查看>>
ZIP排除指定目录进行压缩
查看>>
Spring Boot中使用Swagger2生成RESTful API文档(转)
查看>>
获取定位,苹果IOS10以上不支持h5的geolocation获取不到地理位置信息解决办法
查看>>
Win10 UWP开发系列——开源控件库:UWPCommunityToolkit
查看>>
23. Ext xtype : "combo" 下拉选择框
查看>>
产品功能对标 - 文档与视频
查看>>
Linux内存、性能诊断中vmstat命令的详解
查看>>
闭包总结:闭包的7种形式
查看>>
Codeforces Round #447 (Div. 2) 题解 【ABCDE】
查看>>
数据库表字段命名规范
查看>>
vue $refs的基本用法
查看>>
记录 dts 里面添加 SD cd
查看>>
PDFBOX详解
查看>>
RK3288以太网的mac地址调试笔记【学习笔记】【原创】
查看>>
5.5 进入编辑模式 5.6 vim命令模式 5.7 vim实践
查看>>