Last week, I ran into the same problem that many people have run into- that when you search a db on an R6 server using the db.search method from an R5 client, there are profile documents returned in the document collection. Searching the support site, I found that the problem has been reported.
In the meantime, we wrote a function to remove the profiles from the collection. I am just typing this from memory, rather than copying the code, so you might need to adjust them a little
Function RemoveProfileDocuments(coll As NotesDocumentCollection) As NotesDocumentCollection
Dim doc As NotesDocument
Dim docTemp As NotesDocument
If Not coll Is Nothing Then
Set doc=coll.GetFirstDocument
While Not doc Is Nothing
Set docTemp=coll.GetNextDocument(doc)
If doc.IsProfile=True Then
Call coll.DeleteDocument(doc)
End If
Set doc = docTemp
Wend
End If
Set RemoveProfileDocuments = coll
End Function
Any time that you need to search, wrap this function around your search, and you should be in business, like so:
Set collection = RemoveProfileDocuments(db.Search(…))
I’ve also translated this to java, since we use it too. Here’s a class you can use:
public class Tools {
public static DocumentCollection removeProfileDocuments(DocumentCollection coll) throws NotesException {
Document doc;
Document docTemp;
if (ndc != null) {
doc = coll.getFirstDocument();
while (doc != null) {
docTemp = coll.getNextDocument(doc);
if (doc.isProfile()) {
coll.deleteDocument(doc); }
doc = docTemp;
}
}
return coll;
}
}