| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 718 人关注过本帖
标题:使用ADO插入数据出错
取消只看楼主 加入收藏
ttkl
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-10-16
收藏
 问题点数:0 回复次数:0 
使用ADO插入数据出错

ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('select * from a_doc where bh='''+Trim(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('+Trim(Edtbh.Text)+','+Trim(Edtmc.Text)+')';
ADOQuery2.Close;// 出错
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add(Str_S);
ADOQuery2.ExecSQL;
运行出现错误提示:
Either Eof or Bof is True,or the Current record has been deleted.Requeseted opration requires a Current record .

搜索更多相关主题的帖子: ADO 数据 Trim Edtbh Text 
2006-10-16 17:14
快速回复:使用ADO插入数据出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015636 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved