Hi,
i’m doing a db.search in order to get a collection of documents to generate a report.
The search works fine and returns a coll. with a count of 1891.
However, if i start walking the collection using coll.GetFirstDcoument … GetNextDocument, i never get a valid doc - it always remains “Nothing”.
I already tried coll.GetNthDocument with the same result.
The funny thing is, if i call coll.PutAllinFolder and start walking the folder, the docs are there!
Same with calling coll.StampAll (“MyField”, “Hello”) - it works…
Has anybody any idea? i paste the relevant code for reference…
many thx in advance for your help - i just don’t know what to do to fix this…
Andreas
Code ---------------------------------------
Dim se As New notessession
Dim db As notesdatabase
Dim coll As NotesDocumentCollection
Dim doc As notesdocument
Dim strSearch As String
dim CutOffDate as new notesDateTime (“01/01/2000”)
Set db = se.currentdatabase
strSearch = {(Form = “Kontaktbericht”) & (}
strSearch = strSearch & {@Contains (@Text (@Month (Start)); "} & Cstr (Month (ReportDate.DateOnly))
strSearch = strSearch & {") & @Contains (@Text (@Year (Start)); “} & ReportJahr & {”))}
Set coll = db.Search (strSearch, CutOffDate, 0)
If coll.Count = 0 Then
Error 30000, "No Documents found!"
End If
set doc = coll.GetFirstDocument ’ <— always returns NOTHING!!!
While Not doc is Nothing
... do some processing....
set = coll.GetNextdocument (doc)
Wend
Alternativ code for while-loop:
for i = 1 to coll.count
set doc = coll.GetNthDocument (i) ' <--- ALWAYS REMAINS NOTHING!!!
... do some processing....
next
ANY IDEAS?