!!取数据库的问题!!紧急!为了这个我今天都已经花了300分了--b
代理里面,我想取mail目录下面的所有数据库,并且进行添加ACL的操作。
该怎么办?
前面IBM123大哥给的代码好像不能用于后台代理运行,但是由于只有oaserver/cert和本人有权利对数据库进行操作,所以现在不得不在后台运行代理。
代码如下:
Sub Click(Source As Button)
Dim dbdir As New NotesDbDirectory("")
Dim db As NotesDatabase
Dim ACL As NOTESACL
Dim entryacl As NotesACLEntry
Set db = dbdir.GetFirstDatabase(DATABASE)
While Not(db Is Nothing)
If Strleftback(db.FilePath,"\")<>"mail" Then Goto n
Set acl=db.ACL
Set entryacl=acl.GetEntry("LocalDomainServers")
If entryacl Is Nothing Then
Set entryacl=acl.CreateACLEntry("LocalDomainServers",6)
End If
entryacl.IsServer=True
entryacl.IsGroup =True
Call acl.Save
n:
Set db = dbdir.GetNextDatabase
Wend
End Sub
请问该如何修改?
大家帮帮忙吧!
问题点数:100、回复次数:5Top
1 楼freyild1979(狂风小诗-》孔子曰:莫装B,装B被雷劈)回复于 2004-12-02 08:27:08 得分 10
Dim dbdir As New NotesDbDirectory("")->
试试改成:
dim s as new notessession
Dim dbdir As New NotesDbDirectory(s.servername)Top
2 楼yaorong(辛勤的打字工作者)回复于 2004-12-02 08:38:06 得分 10
我觉得应该做一个表单,做一个多值域将文件列表取出来,你选择,
这样可以对选择到的文件列表,用上面的代码一个一个处理!Top
3 楼EANFS(我的爱是折下自己的翅膀 送给你飞翔)回复于 2004-12-02 09:41:06 得分 10
你可以加一些MessageBox db.Title来进行调试,看是否有取到这些数据库,
我有试了一下,执行十几个数据库后就出错了Top
4 楼hu97142(磕虫)回复于 2004-12-02 10:24:12 得分 10
你的Domino是R5的吗,R5有个不能在后台代理打开异地数据库的Bug,不相信的可以自己去Notes.net找找!Top
5 楼IBM123()回复于 2004-12-02 10:26:40 得分 60
试以下代码,设为定时代码即可。
Sub Initialize
On Error Goto e
Dim s As New NotesSession
Dim dbdir As New NotesDbDirectory("")
Dim db1 As NotesDatabase
Dim db As NotesDatabase
Dim ACL As NOTESACL
Dim entryacl As NotesACLEntry
Set db1 = dbdir.GetFirstDatabase(DATABASE)
x=0
While Not(db1 Is Nothing)
If Strleftback(db1.FilePath,"\")<>"mail" Then Goto n
Set db=s.GetDatabase("",db1.FilePath)
Set acl=db.ACL
Set entryacl=acl.GetEntry("LocalDomainServers")
If entryacl Is Nothing Then
Set entryacl=acl.CreateACLEntry("LocalDomainServers",6)
End If
entryacl.IsServer=True
entryacl.IsGroup =True
Call acl.Save
x=x+1
n:
Set db1 = dbdir.GetNextDatabase
Wend
Msgbox "共处理数据库:" & x
Exit Sub
e:
Msgbox Error & Cstr(Erl)
Exit Sub
End SubTop




