Ado 中使用delete的问题(贵在参与!!!!!!!!!!!!!!!!!!!)

Hxy129 2005-11-08 08:24:45

记录集打开参数
RecordSet.Open(sql, &Connection, adOpenStatic, adLockOptimistic, adCmdText);

在使用AddNew后只有Update后才写到数据库中

但在使用删除函数Delete时直接把数据库中的数据删了,并没有调用Update函数呀??????????????
...全文
147 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodboyws 2005-11-09
  • 打赏
  • 举报
回复
If you are in immediate update mode, deletions occur in the database immediately. If a record cannot be successfully deleted (due to database integrity violations, for example), the record will remain in edit mode after the call to Update.

如果你的数据库是在一种立即更新的模式,删除就立即发生,如果数据不能被立即删除(因为数据库完整性可能受到影响),数据在Update之后被删除
Hxy129 2005-11-09
  • 打赏
  • 举报
回复
to goodboyws(深夜不眠者) :
这个好像说的是Update后不能删除记录。

但我的情况是没有调用Update但确删除了记录,郁闷呀……
goodboyws 2005-11-08
  • 打赏
  • 举报
回复
Using the Delete method marks the current record or a group of records in a Recordset object for deletion. If the Recordset object doesn't allow record deletion, an error occurs. If you are in immediate update mode, deletions occur in the database immediately. If a record cannot be successfully deleted (due to database integrity violations, for example), the record will remain in edit mode after the call to Update.
这个和数据库的设置有关

4,012

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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