如题

解决方案 »

  1.   

    这叫什么问题,adoquery从数据库查询就是了
      

  2.   

    AdoDataSet不是有CommandText吗?用这个执行SQL语句呀
      

  3.   

    delphi好晕啊
    弄不懂
    有没有具体代码
      

  4.   

    adoquery从数据库查询就可以了
    with adoquery do
      begin
       close;
       sql.clear;
       sql.add('select  × where 条件  from 表名')
       open;
       //循环得到相关的信息并写到listbox1控件中即可
      end;
      

  5.   

    function TForm1.CheckUserLogin(sUserid,sPassword:string):Boolean;
    var
      sqlstr:string;
    begin
      if (Trim(sUserid)='') or (Trim(sPassword)='') then
      begin
        Application.MessageBox('请输入用户名或密码','系统提示',64) ;
        Result:=False;
        Exit;
      end;  sqlstr:=' select * from UserManage where userid='''+sUserid+''' and '+
              ' password='''+sUserid+'''';
      with ADOQuery1  do
      begin
        Close;
        SQL.Clear;
        SQL.Add(sqlstr);
        try
          Open;
          if RecordCount=1 then
          begin
            Result:=True;
          end
          else
          begin
            Application.MessageBox('用户名或者密码错误','系统提示',64) ;
            Result:=False;
          end;
        except
          Application.MessageBox('查询数据库异常','系统提示',64) ;
          Result:=False;
        end;
      end;
    end;