No,don't use the close and open,or you will lose you cursor position, I got a way from expert-change.com,is if Query.Next then Query.Prev;there is another way(i find it from the borland online help) Query.Requery
最简单的方法是将DBGrid的Option设为自动刷新
我觉得Nico的意见挺好,但没试过,你试试吧!
若插入的新记录不满足where条件,则应该Refresh一下。
不同意zyb,不满足就是不满足,刷新更不满足。将你输入的数据及Query的语句mail to me,如果你相信我的话,最好带上源程序。如果你在北京且离我不远(我在清华园),那就让我看看你的源程序罗。
注意where语句。
首先,你新插入的记录需要满足你WHERE语句中的条件,
其次,可以用Query1.close;query1.open;
更新后:query1.close;
query1.open;
I got a way from expert-change.com,is if Query.Next then Query.Prev;there is another way(i find it from the borland online help)
Query.Requery