GetAllDocumentsByKey

Hi!

I hope anybody can help me with this…i’m dispairing…

I want to get a datacollection conatining documents of the view MailRoutingEvents in the DB log.nsf. Not all documents, but all documents of a specific day (or time range)…

I tried this:


Set logdb = sess.GetDatabase(server(0),“log.nsf”, False)

’ get the view

Set logView = logdb.GetView(“MailRoutingEvents”)

Dim dc As NotesDocumentCollection

Dim keyArray (0 To 1) As Variant

keyArray(0) = “”

keyArray(1) = Cstr(Now())

Set dc = logView.GetAllDocumentsByKey (keyArray, True)


I always get 0 documents into the collection :frowning:

The first column of the view is a empty one, called “name”, the second is called “date” and contains the current date…

Any ideas?

Subject: RE: GetAllDocumentsByKey

To search a view column that contains dates, use a date value as your key – not a string.

Subject: GetAllDocumentsByKey

The first two columns of the MailRoutingEvents view are both categorized. I have found that GetAllDocumentsByKey will work correctly if the first column is categorized but will not return all of the expected documents if additional columns are categorized.

Gary

Subject: RE: GetAllDocumentsByKey

Also, you are setting one of the array values as Now(), and I believe that is going to return the time to the second, so you might want to trim it down to the day. You will want to check the second column as well, and make sure it is by day too.

Just an idea.

  • Matt