【发布时间】:2015-11-25 10:22:45
【问题描述】:
我想将文档从数据库中的视图传输到其他数据库中的其他视图,因此我必须复制然后删除文档,因为 notesdocument 的唯一选项是复制到数据库。
所以我有这个代码:
Option Public
Option Declare
Sub Initialize()
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim dbB As New NotesDatabase(db.Server,"Desarrollo\Formular_CL02.nsf")
Dim vwA As NotesView
Dim vwB As NotesView
Dim docA As NotesDocument
Dim docB As NotesDocument
'Open the database
If Not (dbB.isopen) Then
Call dbB.open(db.Server,"Desarrollo\Formular_CL02.nsf")
End If
'Get the views
Set vwA = db.getView( "TestDevelop" )
Set vwB = dbB.getView( "TestDevelop" )
Set docA = vwA.GetFirstDocument
Do While Not( docA Is Nothing )
If docB Is Nothing Then
Call docA.CopyToDatabase(dbB)
Call docA.Remove(True)
End If
Set docA = vwA.GetNextDocument(docA)
Loop
End Sub
当我最后执行代理时,它显示一个错误:
Function requires a valid ADT argument
如果我删除有关 Call docA.Remove(True) 的行,代理将复制所有文档而不会出错。
有什么建议吗?
非常感谢!
【问题讨论】:
-
我忘了说agent只执行一个文件,出现错误时agent停止。
标签: lotus-notes lotusscript lotus