表在进行sql语句之前有没有关闭?
麻烦将出错语句标明一下谢谢

解决方案 »

  1.   

    在哪一句上出错?login_dm对象创建了没有?
      

  2.   

    with login_dm.dm_fzdd.wwq_yhb  do是什么意思?
    格式是否为:DataModel.QUERY
          
      

  3.   

    同时,如果query没有close也会出问题.
    在clear前加一句:clsoe;
      

  4.   

    是在
      with login_dm.dm_fzdd.wwq_yhb  do
          出错了
      

  5.   

      with login_dm.dm_fzdd.wwq_yhb  do
          begin
            close;//这儿要先close一下吗?
            sql.Clear;
            sql.add(str1);
            showmessage(str1);
            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;
      
      

  6.   

    login_dm是自动创建的吗?
    execsql要改成open!
      

  7.   

    用了close 可是还是一样的错啊
    快救救我
      

  8.   

    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 login_dm.dm_fzdd.wwq_yhb  do
          begin
    //加上close;
            sql.Clear;
            sql.add(str1);
            showmessage(str1);
            execsql;
    //怎么敢execsql(insert ,update用的),要open呀
          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;
      

  9.   

    再者说了,你只open并不取值,是干什么呀?
    要fieldbyname()
      

  10.   

    一样是错
    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 login_dm.dm_fzdd.wwq_yhb  do
          begin
            close;
            sql.Clear;
            sql.add(str1);
            showmessage(str1);
            open;
            //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;
      

  11.   

      e_yhm.SetFocus这句后面加上exit试试 
      

  12.   

    在 with dm_fzdd.wwq_yhb   do  处出错了
      

  13.   

    出错的信息是:
    access violation at address oo545e4 in modale 'login.exe' read of address 0000084
    在 with dm_fzdd.wwq_yhb  do  处出错了