zoukankan      html  css  js  c++  java
  • Delphi通过查找字符定位TADOQuery数据的位置

         通过TADOQuery的方法Locate,输入字符,查找到定位到对应的数据位置,优点快速定位,缺点是只匹配查找到的和第一个位置,无法连续定位下一个!

    //定位
    qrymembertype.Locate('Cname', Cname, [loCaseInsensitive]);

    'Cname'列名
    Cname 所匹配的值
    loCaseInsensitive, loPartialKey] 不区分大小写,部分匹配
    [loCaseInsensitive] 不区分大小写
    [loPartialKey] 部分匹配
    [] 完全相同

    同进匹配多个属性:
    if edtsearch.Text <> '' then
      begin
        if not qry1.Locate('Cid', edtsearch.Text, [loPartialKey]) then
        begin
          if not qry1.Locate('cname', edtsearch.Text, [loPartialKey]) then
          begin
            qry1.Locate('cago', edtsearch.Text, [loPartialKey]);
          end;
        end;
      end;

  • 相关阅读:
    linux脚本mysql服务与keepalived服务高可用脚本
    linux脚本启动服务脚本
    linux脚本数据库备份脚本
    linux脚本清理日志文件脚本
    最大数字
    求阶乘
    素数
    水仙花数
    js基础1
    css常用属性2
  • 原文地址:https://www.cnblogs.com/jijm123/p/10546509.html
Copyright © 2011-2022 走看看