H
han_wei
Unregistered / Unconfirmed
GUEST, unregistred user!
我用table和datasource部件做一个数据删除程序,数据库为怕paradox表,索引字段为No,代码如下:
procedure tform1.delete_recorder(table: Ttable);
var
i:integer;
begin
table.disablecontrols;
try
if messagedlg('该纪录被删除后将无法恢复!是否继续?',mtconfirmation,[mbyes,mbno],0)=mryes then
begin
table.Delete;
while not table.Eof do
begin
table.edit;
i:=table.fieldbyname('No').value;
table.FieldByName('No').asinteger:=i-1;
table.Next;
end;
end;
finally
table.enablecontrols;
end;
end;
编译后,当删除最后一条纪录时,提示错误如下:
key violant!
再次运行时,提示如下错误信息:
recorder locked by another user
table:........................
user:.........................
请问各位高手,这个问题什么原因造成的?
procedure tform1.delete_recorder(table: Ttable);
var
i:integer;
begin
table.disablecontrols;
try
if messagedlg('该纪录被删除后将无法恢复!是否继续?',mtconfirmation,[mbyes,mbno],0)=mryes then
begin
table.Delete;
while not table.Eof do
begin
table.edit;
i:=table.fieldbyname('No').value;
table.FieldByName('No').asinteger:=i-1;
table.Next;
end;
end;
finally
table.enablecontrols;
end;
end;
编译后,当删除最后一条纪录时,提示错误如下:
key violant!
再次运行时,提示如下错误信息:
recorder locked by another user
table:........................
user:.........................
请问各位高手,这个问题什么原因造成的?