如何用代码清空数据库中的数据!

haoduoren123456789 2003-08-20 09:35:31
如何用代码清空数据库中的数据!
...全文
110 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jhlqab 2003-08-22
  • 打赏
  • 举报
回复
也只有这样了。
tianzl 2003-08-22
  • 打赏
  • 举报
回复
用代理啊,首先搜索到数据库中的所有文档,然后逐一删除!
具体代码帮助中有很多相近的,找到后直接考过来稍加修改就能用!
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.AllDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
Call doc.Remove( True )
Set doc = collection.GetNextDocument(doc)
Wend

代码是直接考过来的,没经过测试!你自己试试看吧
haoduoren123456789 2003-08-22
  • 打赏
  • 举报
回复
加分了大家努力呀
newman78 2003-08-22
  • 打赏
  • 举报
回复
db.AllDocuments包含答复或答复的答复文档吗?
chenyg2000 2003-08-22
  • 打赏
  • 举报
回复
已经写得很好了,顶一下
sacrefies 2003-08-22
  • 打赏
  • 举报
回复
我补充问一句:楼主你还需要删除你的设计文档不?
davidnim 2003-08-22
  • 打赏
  • 举报
回复
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
Call doc.Remove( True )
Set doc = collection.GetNextDocument(doc)
Wend
上面代码直接,换成
Call collection.removeAll(True)

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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