LotusScript to C API Programming Guide

rtLib Domino Rich Text Management template
Show details for ContentContent
Ready-to-use samples
Show details for Online resourcesOnline resources
Happy readers




Hosted by Prominic.NET, Inc.
Main topic: Need a fast way to find out the number of documents in a database

Need a fast way to find out the number of documents in a database (by Kenneth Haggman, 09/11/2007 10:10:25 AM)

Hi Normunds,

When one opens the Properties for a database one can see immediately the number of documents the database has.

Is it possible to get this info in a quick way, perhaps by using the C API?

With 'pure' LotusScript I have 3 options:

1. Use the NotesDatabase.AllDocuments property. This will indeed give me all the documents in a NotesDocumentCollection but it takes a really long time for a large database. In addition, there seems to be some 'funny' bugs when you loop through a really large collection obtained through this property. The Count property has the correct value but the GetFirstDocument and GetNextDocument methods sometimes fails!

2. Use the NotesDatabase.Search method. Same as bove but even slower.

3. Use a NotesNoteCollection. This is the fastest of the methods and there are no problems with looping. Despite being the fastest, it is still way too slow if all you want is to quickly display the number of documents in a database.

I have been reading the C API doco and came across the NSFDbGetNotes API.

This seems like it could be useful but it has a rather complicated structure with callbacks and stuff.

Do you have any experience from using this API?

Do you perhaps know of an alternative, fast, way to get the number of documents in a database?

// Ken