not gotokey 总是 true
但是我表中有匹配的数据

解决方案 »

  1.   

    试试
    with table1 do
      begin
        setkey;
        fieldbyname('audit_oper_no').asstring:=edit1.text;
        if not gotokey then showmessage('hi');
      end;
      

  2.   

    你数据库打开了没有,
    with table1 do
      begin
        open;
        setkey;
        fieldbyname('audit_oper_no').asstring:=edit1.text;
        if not gotokey then showmessage('hi');
      end;
      

  3.   

    'audit_oper_no'没有设成主键是不是
      

  4.   

    audit_oper_no必须是关键字段或辅助索引字段。