for I:=no to h do
begin
content.Edit;
content['indexno']:=content['indexno']+1;
post;
end;
中并没有改变要修改的记录的指针,你修改的只是一条记录,用如下方法试一试:
for I:=h Downto to no do
begin
with content do
begin
Edit;
Locate('indexno',VarArrayOf([i]),[]);
content['indexno']:=content['indexno']+1;
//or content['indexno']:= i+1;
post;
end;
end;
begin
content.Edit;
content['indexno']:=content['indexno']+1;
post;
end;
中并没有改变要修改的记录的指针,你修改的只是一条记录,用如下方法试一试:
for I:=h Downto to no do
begin
with content do
begin
Edit;
Locate('indexno',VarArrayOf([i]),[]);
content['indexno']:=content['indexno']+1;
//or content['indexno']:= i+1;
post;
end;
end;
贴子我回复了五次,才贴上...
但是有另外的问题,它老是提示我KEY/RECORD DEL 有没有方法给它更新一下呢var i:integer;book1:tbook;
begin
try
with content do
begin
book1:=content.GetBook;
content.DisableControls;
if content.FieldByName('indexno').AsInteger=no then
begin
if content.FieldByName('content').AsString=char then
next
else
begin
content.Edit;
content['indexno']:=content['indexno']+1;
content['content']:=content['content'];
no:=no1+1;
char:=content['content'];
post;
content.GotoBook(book1);
end;
end
else
begin
next;
content.GotoBook(book1);
content.EnableControls;
content.FreeBook(book1);
end;
end;
finally
content.Refresh;
end;