你还没有用户名和密码怎么登录怎么执行SQL语句查用户名呢?

解决方案 »

  1.   

    adoquery1.close;
    adoquery1.sql.clear;
    adoquery1.sql.add('select password from user where username=');
    adoquery1.sql.add(''''+dbcombobox1.text+'''';
    adoquery1.open;
    if adoquery1.isempty then
    begin
      //空为无此用户
    end
    else
    begin
      if   adoquery1.FieldByName('password').AsString =密码 then
       begin
         密码正确
       end
      else
        密码出错
      

  2.   

    打错了更正
    adoquery1.close;
    adoquery1.sql.clear;
    adoquery1.sql.add('select password from user where username=');
    adoquery1.sql.add(''''+dbcombobox1.text+'''');
    adoquery1.open;
    if adoquery1.isempty then
    begin
      //空为无此用户
    end
    else
    begin
      if   adoquery1.FieldByName('password').AsString =密码 then
       begin
         密码正确
       end
      else
      begin
        密码出错
      end;
    end;
      

  3.   

    select *from user 
    出错是因为user是保留字.改成 select * from [user]
      

  4.   

    不行呀,运行了以后还是出错了,他说from 子句语法错误。。怎么办
      

  5.   

    用user.db或user.mdb
    如果不行就不知道了
    因为平使用的都是按照luoweicaisd的给是来用
      

  6.   

    把你写的SQL语句搬到SQL的客户端查询上用一用试试,
    (不知用的什么数据库,象MS SQL 6.5叫IWSQL)