为什么 更新  access 数据库时 要等 2-3 秒 才能看到更新的数据??????例如:
有一个叫 table1 的表 ,有一个长整型的 maxid 字段 :maxid 
 1 
--------------------------------使用下面的代码进行更新:adocommand1.CommandText:='update table1 set maxid=2  ';
    adocommand1.Execute;
然后马上使用下面代码查看maxid:adodataset1.Active :=false;
adodataset1.CommandText:='select * from table1';
   adodataset1.Active :=true;
但数据maxid还是 1 要等 2-3 秒后 ,执行 下面代码:
adodataset1.Active :=false;
adodataset1.CommandText:='select * from table1 ';
   adodataset1.Active :=true;
这时 maxid 值才是 2 
---------------------------------
为什么要等 2-3 秒后  ,才看 到 更新的 数据 ????  这是 access 本身的问题吗??  sql server 也有这样的问题吗?????

解决方案 »

  1.   

    有时延的,我用sql server做的有时也会出现这种问题,不过是通过网络的;
      

  2.   

    將 adodataset1聯接的那個 ADOConnection1 關閉下再打開呢??
      

  3.   

    我没有用ADOConnection, 是用 adodataset 直接 连的
      

  4.   

    我没有设置过 adodataset 任何东西,应该是默认设置 , 请问应该如何设置???
      

  5.   

    ADO连接时有几个选项,其中有一个就是在服务器上执行的,自己读一下属性,比较简单的E文……
    设置了之后可能会解决你的问题……
    不过设置成服务器连接后,其他使用时可能产生部分问题……
      

  6.   

    把cusorlocation设成 clUseServer  也不行呀!!
      

  7.   

    你试试不要Active:=false
    用adodataset.close,然后再open
      

  8.   

    我试过 open 和close 也不行!!  我试过在 sql server 没有廷时 ,  access 真是破东西!!!
      

  9.   

    你重新建个PROJECT试试……(简单测试一下)
    在一开始就设置为使用SERVER模式,再写入看看
    注意,ADO连接器和ADO表、ADO查询都有这个属性项目,注意将其设为一致……