启动/关闭数据库中的定时共享代理

Sub Initialize    On Error Goto errhandle  Dim ss As New notessession  Dim db As notesdatabase   Set db = ss.currentdatabase    Forall a In db.agents     If a.trigger=TRIGGER_SCHEDULED And a.ispublic Then    If a.isenabled Then     a.isenabled=False     Msgbox "定时代理:"& a.name &"已经禁止"     Call a.save    Else          a.IsEnabled = True     Call a.Save     Msgbox "定时代理:"& a.name &"已经启动"    End If   End If  End Forall   Exit Sub errhandle:  Msgbox "允许错误,错误行:" + Cstr(Erl) + "错误:" + Error$    End Sub

你可能感兴趣的:(Domino,数据库)