sqltr:='select * from 管理员 where  (username='+''''+edit1.Text+''''+')  and
    (password='+''''+edit2.text+''''+')';

解决方案 »

  1.   

    看起来没有错啊。也可以这么写:
    sqltr:='select * from 管理员 where (username='''+edit1.Text+''') and (password='''+edit2.text+''')';
      

  2.   

    试下,这样对不?sqltr:='select * from 管理员 where username='''+''''''+edit1.Text+''''''+'''  and password=''''+''''''+edit2.text+'''''+'''';
      

  3.   

    也就是这样写就可以
    sqltr:='select * from 管理员 where username='''+edit1.Text+''' and password='''+edit2.text+'''';
      

  4.   

    没有错啊~~
    可以改为:
    sqltr:='select * from 管理员 where  (username='+quotedstr(edit1.Text)+')+and (password='+quotedstr(edit2.text)+')';