ACCESS数据库中的缓存更新问题(30分)

  • 主题发起人 主题发起人 lcl800
  • 开始时间 开始时间
L

lcl800

Unregistered / Unconfirmed
GUEST, unregistred user!
---------------------------
ACCESS数据库中的缓存更新问题

db1.mdb库中的users表已建立主索引

先删除数据
with Adoquery1 do begin
close;
sql.text:='delete from users'
execSQL;
end;
再追加数据:
with ADOtable1 do begin
open;
append;
fieldbyname('xm').asstring:+'aaa'
post;
emd;

只要一执行 ADOTable1.refresh,则出现下述错误:
'Row cannot be located for updating.
Some values may have been changed since it was last read'.


如果表中有数据,先执行了删除操作,也会出现如下提示:

Project ckgl.exe raised exception class EOleException with message
'Row cannot be located for updating.
Some values may have been changed since it was last read'.

请问如何解决?
 
先关闭Table,再用Query,或者直接用Table来删除,不要开着一个,调用另一个。
 
with ADOtable1 do begin
If Active Then
ReQuery
Else
Open;
append;
fieldbyname('xm').asstring:+'aaa'
post;
//ReQuery;
emd;
 
多人接受答案了。
 
后退
顶部