with Query1 do
begin
  Close;
  SQL.Clear;
  SQL.Add('Select * From Table1');
  Open;
end;先打开表,然后在EditChange时使用Locate或者FindKey定位,如果定位到则存在

解决方案 »

  1.   

    在 ONCHANGE 事件中:
    一个一个的读出字段,然后再用 POS(‘输入框中的字符’,‘字段字符’)>0 返回找到了。
      

  2.   

    if EdtCust_id.Text='' then
        exit;
    if Query.Active then
       Query.Close;
    Query.SQL.Text='select * from where        
                  FieldName='+''''+EdtCust_id.Text+'''';
    Query.SQl.Open
    if Query.RecordCount<=0 then
        ShowMessage('no record');
      

  3.   

    if (EdtCust_id.Text)='' then exit;
    if Query.Active=true then
       Query.Closel;
    Query.SQL.Text='select * from 表名 where     
          FieldName'+''''+Trim(EdtCust_id.Text)+''''
    Query.Open
    if Query.IsEmpty then
       ShowMessage('no record!');