请教大家:
    我要用ADOQuery检索ACCESS, 在form上放了个文本框供输入检索值,然后点击按纽,将文本框的值加入SQL语句赋值给ADOQuery,以供查询。
问题是,我取到值后,如何赋值给ADOQuery的SQL让它查询,语句怎么写。谢谢

解决方案 »

  1.   

    ADOQuerysend.Close;
      ADOQuerysend.SQL.Clear;
      ADOQuerysend.SQL.Add('select * from sys_alert_tmp where id='+Edit1.text);
      ADOQuerysend.Open;
      

  2.   

    s:='select * from sys_alert_tmp where id=' + QuotedStr(Edit1.text);
      ADOQuerysend.Close;
      ADOQuerysend.SQL.Clear;
      ADOQuerysend.SQL.Add(s);
      ADOQuerysend.Open;
      

  3.   

    顶啊,总算找到了“QuotedStr”这个函数!
      

  4.   

    'select * from sys_alert_tmp where id=' +QuotedStr(Edit1.text);