有这样的一段代码:
…… //先前的修改
Table7.Post;
Table7.Close;
Table7.Open;
j := Table7.RecordCount; //调试 j = 40 表明有40条记录
//Table7.DisableControls;
Table7.First;
j := 0;
while not Table7.Eof do
begin
Table7.Edit;
Table7.Fields[14].Value := strtofloat(sContractArray[strtoint(Form2.Table7.Fields[7].Value),3]);
Table7.Post;
j := j+1;
Table7.Next;
end;
//调试 j = 22 表明有22条记录
j := Table7.RecordCount; //调试 j = 40 表明有40条记录
// Table7.EnableControls;问题是为什么这程序只遍历22条记录呀?
…… //先前的修改
Table7.Post;
Table7.Close;
Table7.Open;
j := Table7.RecordCount; //调试 j = 40 表明有40条记录
//Table7.DisableControls;
Table7.First;
j := 0;
while not Table7.Eof do
begin
Table7.Edit;
Table7.Fields[14].Value := strtofloat(sContractArray[strtoint(Form2.Table7.Fields[7].Value),3]);
Table7.Post;
j := j+1;
Table7.Next;
end;
//调试 j = 22 表明有22条记录
j := Table7.RecordCount; //调试 j = 40 表明有40条记录
// Table7.EnableControls;问题是为什么这程序只遍历22条记录呀?
解决方案 »
- 各位大侠,这个功能如何实现?
- Indy的demo中chat为什么一运行就死机?
- 哪位大哥有Delphi5企业版?
- 请问treeview怎么用我看了好几个例子还没不太明白!自己写一个也报错,大家给看看!
- 使用gifimage单元,如何把已有的图片做成gif动画?
- 哪位gg jj用过teechart,帮俺简单提示一下: 我有个三列n行的数组!在三维坐标上画一根线
- 关于datetimepicker的问题:
- 请问各位大哥局域网中如何使用OUTLOOK收发邮件呀
- 怎样将一个变量的地址赋给指针变量?
- 怎么样计算时间的差值????高手请进
- 100份求购delphi简单源码,不够再加!
- delphi新丁请求急救!BDE连接远程数据库问题!!(100分)
//调试 j = 22 表明有22条记录
showmessage(inttostr(j));//添加这条试试,看显示多少
j := Table7.RecordCount; //调试 j = 40 表明有40条记录
而用 j := Table7.RecordCount; 是统计所有的。Form2.Table7.Fields[7].Value只
执行某个字段
改为:Table7.First;
j := 0;
while not Table7.Eof do
begin
Table7.Edit;
Table7.Fields[14].Value := strtofloat(sContractArray[strtoint(Form2.Table7.Fields[7].Value),3]);
j := j+1;
Table7.Next;
end;
table1.post;
这句结束后就在设断点j = 40
以lxy13(甜甜)的方法出现了Table7: dataset not in edit or insert mode.
还有Form2.Table7.Fields[7].Value 都不为空。
Table7.First;
j := 0;
while not Table7.Eof do
begin
Table7.Edit;
Table7.Fields[14].Value := strtofloat(sContractArray[strtoint(Table7.Fields[7].Value),3]);
j := j+1;
Table7.Next;
end;
table7.post;在 table7.post;设断点,j = 22,接着出现了Table7: dataset not in edit or insert mode