Best way to get number of documents using C API

What is the best/fastest way to get the number of documents in a database using C API?

As far as I can see, there’s no function in the API reference for this information. In Lotusscript the only way to get the count is to use the count of the all documents collection, which is awfully slow.

As it is available in the info box (and is pretty quick), there must be a better way to do this.

Any info is greatly appreciated.

cheers,

Bram

Subject: Best way to get number of documents using C API

Hi Bram,

there sure is. This is how i’ve done it from Delphi (should be straightforward from C). noteClass should be NOTE_CLASS_DOCUMENT :

function TNotesDatabase.GetNoteCount(noteClass: Word): integer;

var

fromDate: TIMEDATE;

untilDate: TIMEDATE;

retTable: LHandle;

begin

OSCurrentTIMEDATE(@untilDate);

TimeConstant(TIMEDATE_MINIMUM,	fromDate);



CheckError(NSFDbGetModifiedNoteTable(

      	Handle,

      	noteClass,

      	fromDate,

          @untilDate,

        @retTable));



Result := IDEntries(retTable);



IDDestroyTable(retTable)

end;

regards

Daniel

Subject: RE: Best way to get number of documents using C API

Works like a charm.

Thanks!

Bram