回 帖 发 新 帖 刷新版面

主题:这样做一下看一看行不行呀?

ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('select * from a_doc where bh=‘+quotedstr(Edtbh.Text);
ADOQuery2.Open;
  if ADOQuery2.RecordCount>0 then 
      begin
        application.MessageBox('编号重复!','提示信息',mb_ok+mb_iconinformation);
        Edtbh.SetFocus;
        exit;
      end;

   Str_S:='Insert into  a_doc (bh,mc)values('+quotedstr(Edtbh.Text)+'quotedstr(Edtmc.Text)+')';
ADOQuery2.Close;// 出错
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add(Str_S);
ADOQuery2.ExecSQL;

回复列表 (共2个回复)

沙发

[quote]ADOQuery2.Close;// 出错[/quote]
Delphi提示"出错"两个字吗?

板凳

Str_S:='Insert into  a_doc (bh,mc)values('+quotedstr(Edtbh.Text)+','+quotedstr(Edtmc.Text)+')';

我来回复

您尚未登录,请登录后再回复。点此登录或注册