login_dm是什么?是窗体?创建了没有?

解决方案 »

  1.   

    login_dm.dm_fzdd.wwq_yhb
    是什么?控件吗?如果是控件的话,中间那个就不应该写,就是这样:login_dm.wwq_yhb
      

  2.   

    login_dm.dm_fzdd.wwq_yhb 应该是一个ADOQuery1或者Query1
    //////
    procedure TForm1.bb_yesClick(Sender: TObject);
    var
      a, b :string;
      str1 :string;
    begin
      a:=trim(e_yhm.text);
      b:=trim(e_yhmm.text);
      str1:='select *  from  t_yhb  where  yhm='''+trim(a)+'''  and  yhmm='''+trim(b)+'''';
      with ADOQuery1或者Query1 do///
          begin
            close;
            sql.Clear;
            sql.add(str1);
            showmessage(str1);
            try
            open;
           except
           begin
            ShowMessage('数据库打开出错!');
            Exit;
           end;
           // execsql;
          if login_dm.dm_fzdd.wwq_yhb.IsEmpty  then
            begin
              showmessage('你输入的用户名和密码有误!');
              e_yhm.text:='';
              e_yhmm.text:='';
              e_yhm.SetFocus;
            end
        else
            form2.Show;
            //form1.Close;
      end;
      //close;
    end;
      

  3.   

    procedure TMainForm.FormShow(Sender: TObject);
    begin
      if loginform.ShowModal<>mryes then
        close;
      self.Top:=20;
      self.Left:=20;
    end;
      

  4.   

    改了还是一样错的啊
    procedure TForm1.bb_yesClick(Sender: TObject);
    var
      a, b :string;
      str1 :string;
    begin
       a:=trim(e_yhm.text);
       b:=trim(e_yhmm.text);
       str1:='select *  from  t_yhb  where  yhm='''+trim(a)+'''  and  yhmm='''+trim(b)+'''';
       with dm_fzdd.wwq_yhb   do
          begin
            close;
            sql.Clear;
            sql.add(str1);
            showmessage(str1);
            try
               open;
            except
              begin
                ShowMessage('数据库打开出错!');
                Exit;
              end;
          // execsql;
           if login_dm.dm_fzdd.wwq_yhb.IsEmpty  then
              begin
                showmessage('你输入的用户名和密码有误!');
                e_yhm.text:='';
                e_yhmm.text:='';
                e_yhm.SetFocus;
              end
           else
            form2.Show;
            //form1.Close;
      end;
      //close;
    end;
    end;