不知道! 我猜的 ssql:=ssql + 'where A.sta_id= '''staid''' and B.dep_password='''passwd''' '
 该成
 ssql:=ssql + 'where A.sta_id= '''+staid+''' and B.dep_password='''+passwd+''' '
 试一试吧!  另外把 Query.text显示出来 showmessage(Query.text)看看SQL语句有没有问题,还有你用的是什么数据库呀?
 

解决方案 »

  1.   

    if query1.FieldByName ('c').asinteger  =1 then
              begin
                showmessage('恭喜,您成功登錄了!');
                Form2.show;
                Form1.close;
              end
            else
              begin
                if MessageDlg('輸入身份錯誤,是否重登錄?',mtconfirmation,[mbyes,mbno],0)=mryes  then
                  begin
                    edit1.text:='';
                    edit2.text:='';
                    edit1.SetFocus;
                  end
              // 这个else是那个if的?  
              //else   
              //  close;
            end;      
      

  2.   

    修改為passwd:=Edit2.text;後
    (2)處還有同樣的錯 ,錯在哪?????        
      

  3.   

    to: nodefault(永不言败) 
    http://www.csdn.net/Expert/topic/473/473821.shtm
    为何不加分
      

  4.   

    對不起我剛才各加20分時發生錯誤!以後一定給
    老問題解決了.不過在執行query1.open 語句時發生錯誤,我把鼠標放到ssql變量處,sql好像是對的,
    delphi中能不能把sql語句打印出來(asp中有的,),在query analyzer 中運行???