当前位置:主页>销售管理软件> 列表

关于AdoDataSet的Eof问题

财务软件版1楼: 在AdoDataSet中打开一个文件,对文件进行操作,需要更新部分记录,这时一般做法是
例如:Filter:=''state=0''
然后
while not eof do
begin
edit;
//修改记录内容
next;
end;
例如:有5条记录的state=0,但是通常都移动两条记录后,eof就为True了,该如何解决呢

2楼: filter之后first,再do while 如jde财务软件报价

3楼: First了

4楼: 把next改成post

5楼: 也搞了,也不行

6楼: Filtered:=false;
Filter:=''state=0'';
Filtered:=true;
First;
while not eof do
begin
edit;
//修改记录内容
Post;
next;
end;

财务软件版7楼: 都不行,估计这个EOF属性取值有问题

8楼: first;
while not eof do
begin
if state = 0 then
begin
edit;
修改记录内容;
post;
end;
next;
end;

9楼: 答案有了,就是用文件方式打开的数据集在POST时一定要SAVETOFILE才行,不然POST根本不能成功,感谢支持,顶者有分。

10楼: 多人接受答案了。