couldn't perform the edit because another user changed the record(50分)

9

998169

Unregistered / Unconfirmed
GUEST, unregistred user!
在修改表时,出现如下错误信息:(c/s结构数据程序)
couldn't perform the edit because another user changed the record!
后,程序中断运行,请问是怎么回事?,如何铺获此错误,不显示错误信息,使
程序继续运行下去!
 
有可能是你update 记录是 此记录不存在
 
试试这样可不可以,if table1.state = dsedit then exit else table1.edit;
 
此错误是在两台客户机同时运行以下代码时产生的:
begin
starttime:=GetTickCount;
startTime1:=StartTime;
if not dmhui.tbSfcp.active then dmhui.tbSfcp.open;
dmhui.tbSfcp.first;

// ch:=dmhui.tbSfcp.fieldbyname('cp').asBoolean;
ch:=dmhui.tbSfcp.fieldbyname('cp').asstring ;
While ((GetTickCount-StartTime)<120000) and (ch='1') do
begin
// MessageBox(Handle, '正在等待存盘。', '提示', MB_OK);

if GetTickCount-startTime1 >5000 then
begin
dmhui.tbSfcp.first;
dmhui.tbSfcp.refresh;
ch:=dmhui.tbSfcp.fieldbyname('cp').asstring;
startTime1:=GetTickCount;
end;
end;
if (GetTickCount-starttime)>=120000 then
if ch='1' then
begin
MessageBox(Handle, '连接超时,稍候再试,如再出错,请通知MIS部。', '提示', MB_OK);
exit;
end;
if ch='0' then
begin
dmhui.tbSfcp.edit;
dmhui.tbSfcp.fieldbyname('cp').asstring:='1';
dmhui.tbSfcp.Post;
end;
 
搞不懂,还是不明白,还是没解决
 
顶部