Parameter not found的出現的原因

來源:互聯網
上載者:User
  1.   with dataM.Q_xfgl_dhjf do
  2.   begin
  3.     close;
  4.     sql.Clear;
  5.     sql.Add('insert into jfdh(jfdh_id,jfdh_hybh,jfdh_dhjf,jfdh_bz,jfdh_sj,jfdh_czr) ');
  6.     sql.Add('values(:jfdh_id,:jfdh_hybh,:jfdh_dhjf,:jfdh_bz,:jfdh_sj,:jfdh_czr);') ;
  7.     
  8.     Parameters.ParamByName('jfdh_id').Value := getid();
  9.     parameters.ParamByName('jfdh_hybh').Value := hy_id;
  10.     parameters.ParamByName('jfdh_dhjf').Value := strtoint(edit1.Text);
  11.     parameters.ParamByName('jfdh_bz').Value := memo1.Text;
  12.     parameters.ParamByName('jfdh_sj').Value := now;
  13.     parameters.ParamByName('jfdh_czr').Value := user;
  14.   end;

以前都是這麼用的,可是今天卻一直提示Parameter jfdh_id not found,把Parameters.ParamByName('jfdh_id').Value := getid();這句注釋掉後,就提示後邊的參數沒有找到。

有人說values後要加空格,加了不行。重新寫一遍,看是不是輸入漢字字元了?試了各種方法,還是沒解決問題.

後來看到有高人總結了三種原因 :

出現   ADOQuery1   :   parameter   "***r"   not   found   的提示的原因:  
  1、SQL語句本身無參數;  
  2、ADOQuery1的ParamCheck屬性為False;  
  3、未設定ADOQuery1的Connection或ConnectionString屬性。  

仔細一檢查,靠,第三條。灰頭土臉的取改 。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.