ADOQuery1.SQL.Clear;
 ADOQuery1.SQL.Add('select pwd from login where uid='''+ Edit1.Text + '''');
 ADOQuery1.ExecSQL;
 Edit3.Text:=ADOQuery1.FieldValues['pwd'];

解决方案 »

  1.   

    ADOQuery1.SQL.Add('select pwd from login where uid='+ '''Edit1.Text''');
      

  2.   

    ADOQuery1.SQL.Add('select pwd from login where uid='+''''+ Edit1.Text+'''');
      

  3.   

    ADOQuery1.SQL.Clear;
     ADOQuery1.SQL.Add('select pwd from login where uid=:param1');
     ADOQuery1.parameters.ParamBYName('param1').value:=Edit1.Text;
     ADOQuery1.ExecSQL;
     Edit3.Text:=ADOQuery1.FieldValues['pwd'];
      

  4.   

    如淘气男孩所说,我也试过
    可是错误“adoquery1:field'pwd'not found"
    怎么回事?明明有这列啊
      

  5.   

    诸位帮忙帮到底吧
    我都试过了
    最后都是field 'pwd' not found
    为什么呢?
      

  6.   

    adoquery1.close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Add('select pwd from login where uid=''' +  
                       trim(Edit1.Text) + '''');
    ADOQuery1.ExecSQL;
    Edit3.Text:=adoquery1.FieldByName('pwd').AsString;
      

  7.   

    还是不行啊
    唉,无论我换那个字段名,都是not found
    待会儿再来看看
    谢谢诸位,解决不了的话
    全部有分
      

  8.   

    adoquery1.close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Add('select pwd from login where uid=''' +  
                       trim(Edit1.Text) + '''');//如果uid是字符类型的就这样写,如果是数值类型的,就
    //ADOQuery1.SQL.Add('select pwd from login where uid= '+trim(Edit1.Text);
    //这里面是大小定、全角半角要完全一样才能查到,
    ADOQuery1.ExecSQL;Edit3.Text:=adoquery1.FieldByName('pwd').AsString;//这里请注意类型。
      

  9.   

    SELECT 语句是用ADOQuery.Open方法打开,其它的才是用ADOQuery.ExecSQL。找错点了。
      

  10.   

    ADOQuery1.SQL.Clear;
     ADOQuery1.SQL.Add('select pwd from login where uid='+ Edit1.Text);
     ADOQuery1.ExecSQL;
    Edit3.Text:=ADOQuery1.Fields[0].AsString;如果还是不行,请查一下你的数据库,最后不要使用login做表的名称。
      

  11.   

    试试用
    ADOQuery1.SQL.Add('select * from login where uid='+ '''Edit1.Text''');
    不行再加
    ADOQuery1.Open
    看看。