调用过程出错——“无法更新;当前被锁定”! 编写了一个过程A,用来对字段进行更新操作,逐次调用A的时候运行正常。当连续调用A的时候,比如连续更新几个字段时就会出现错误无法更新;当前被锁定”!请教高手这是为什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure a(fieldname:string;control1,control2:tedit);var condition:string; adoquery_jtxmdjb:tadoquery; x,y:string; begin y:=fieldname; x:=control1.text; condition:='xmlxbh='''+control2.text+''''; adoquery_jtxmdjb:=Tadoquery.Create(nil); with adoquery_jtxmdjb do begin adoquery_jtxmdjb.connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\科研申报系统3.0\kysbdb.mdb;Persist Security Info=False'; //记得加连接 sql.clear; sql.add('update xmzaiyan set '+y+'='+quotedstr(x)+' where '+condition+''); execsql; end; end;调用a('xmfzr1_xb',edit_xmfzr1_xb,edit_xmpzh); a('xmfzr1_csny',edit_xmfzr1_csny,edit_xmpzh); a('xmfzr1_zy',edit_xmfzr1_zy,edit_xmpzh); a('xmfzr1_xl',edit_xmfzr1_xl,edit_xmpzh); a('xmfzr1_zc',edit_xmfzr1_zc,edit_xmpzh); a('xmfzr1_lxdh',edit_xmfzr1_lxdh,edit_xmpzh); 出现上述错误,如果只执行a('xmfzr1_xb',edit_xmfzr1_xb,edit_xmpzh); 时是好的,单步执行也全部可以。为什么?是不是对数据库表的访问冲突? 数据库查询 REPORT BUILDER导出PDF乱码问题。 动态创建LABEL alignment无效的问题 delphi下面有无带html格式编辑的编辑控件? 使用owc.spreedsheet 导入excel的问题,如何在单元格内自动换行? 各位老大,偶菜的无比,传送文件的问题。。 怎么让下拉列表中的item提示hint阿? Web 做电子商务感觉总不如传统的窗口程序 散分! 问一个数值类型转换问题(procedure与int) 快帮帮忙,老板要扣工资了??? 初学者数据库统计的问题!
var
condition:string;
adoquery_jtxmdjb:tadoquery;
x,y:string;
begin
y:=fieldname;
x:=control1.text;
condition:='xmlxbh='''+control2.text+'''';
adoquery_jtxmdjb:=Tadoquery.Create(nil);
with adoquery_jtxmdjb do
begin
adoquery_jtxmdjb.connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\科研申报系统3.0\kysbdb.mdb;Persist Security Info=False'; //记得加连接
sql.clear;
sql.add('update xmzaiyan set '+y+'='+quotedstr(x)+' where '+condition+'');
execsql;
end;
end;
调用
a('xmfzr1_xb',edit_xmfzr1_xb,edit_xmpzh);
a('xmfzr1_csny',edit_xmfzr1_csny,edit_xmpzh);
a('xmfzr1_zy',edit_xmfzr1_zy,edit_xmpzh);
a('xmfzr1_xl',edit_xmfzr1_xl,edit_xmpzh);
a('xmfzr1_zc',edit_xmfzr1_zc,edit_xmpzh);
a('xmfzr1_lxdh',edit_xmfzr1_lxdh,edit_xmpzh);
出现上述错误,如果只执行a('xmfzr1_xb',edit_xmfzr1_xb,edit_xmpzh); 时是好的,单步执行也全部可以。为什么?是不是对数据库表的访问冲突?