adotable存储的问题

supercctv 2003-02-25 10:21:16
在c++builder中,使用adotable操作access数据库,如果要实现下列操作,该怎么办:

使用dbgird,如果用户改动了数据,这时移动指针后,改动的数据就会存盘,有没有什么办法,能使数据暂不写入数据库,而是等用用户按下“存盘”后,再写入库中。

记得在table中可以使用缓存,adotable中没有,怎么办?

急!!!
...全文
52 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
watercelery 2003-02-26
  • 打赏
  • 举报
回复
支持Libran()方法
ai0ai 2003-02-26
  • 打赏
  • 举报
回复
如果是ADOQuery连结的话,先设置ADOQuery-〉LockType=ltBatchOptimistic
比如说用button实现保存,然后在button onclick事件里写:
ADOQuery-〉UpdateBatch(arAll);

就可以了
ADOTable一样的道理
chpeng 2003-02-26
  • 打赏
  • 举报
回复
同意 Libran()方法
afei_001 2003-02-26
  • 打赏
  • 举报
回复
这是帮助文件:
Use LockType to specify the lock type to use when opening a dataset. LockType determines whether the row locking scheme for a recordset will be pessimistic, optimistic, or read-only. To be effective, LockType must be set prior to activating the ADO dataset component.

The default value of LockType is ltOptimistic.

Use the LockType ltBatchOptimistic to open a dataset in batch update mode.
cuptbluesky 2003-02-25
  • 打赏
  • 举报
回复
同意楼上
Libran 2003-02-25
  • 打赏
  • 举报
回复
将 TADOTable 对象的 LockType 属性改为 ltBatchOptimistic,此时ADOTable为批更新模式
修改完成后须用调用ADOTable->UpdateBatch(arAll)方法才会更新数据库

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧