在窗体中btnadd,btnmodify,btnsave,dbedit1,dbgrid1,datasource1,adotable1
dbedit和dbgrid通过datasource1与adotable1相连。
  我是想点btnadd,调adotable1.append方法,点btnsave,调post方法。但是发现在我post之前,dbedit就已经讲记录加入了数据库,什么原因呢?
  修改时adotable.edit方法可能也存在类似问题,没有试。
一句话:如何控制数据浏览组件,使得我调用post方法才写入数据库。
  不要告诉我设置readonly属性,我会。

解决方案 »

  1.   

    CachedUpdates enables or disables the use of cached updates for a dataset. If CachedUpdates is True, cached updates are enabled. If CachedUpdates is False, cached updates are disabled.When cached updates are enabled, updates to a dataset (such as posting changes, inserting new records, or deleting records), are stored in an internal cache on the client machine instead of being written directly to the dataset抯 underlying database tables. When changes are complete, an application writes all cached changes to the database in the context of a single transaction.学会看帮助