Doc.responses.count returns error

After upgrading our domino server from 6.03 to 6.5.2, we have this weird problem in one of our databases :

in LotusScript, the NotesDocument.Responses behaves differently when the document has no response documents. Before the upgrade Notesdocument.Responses returned an empty documentcollection, so one could use :

If NotesDocument.Responses.Count = 0 Then …

After the upgrade, this line returns an error, (Object Variable not Set) and it seems that NotesDocument.Responses returns ‘Nothing’ as a result. So now I have to use :

if (NotesDocument.Responses) Is Nothing then …

Even weirder :

the problem does not occur on a local replica

I cannot reproduce this behaviour in other databases

I ran fixup, compact and updall with no joy …

other info : ODS=43 , Transactional logging is enabled. Domino 6.5.2 on win 2000 and Notes client 6.5.2 on win XP

Subject: solved (sort of …)

a ‘load compact -B abc.nsf’ on the server seemed to make the problem go away!

Subject: specialized response hierarchy and notesdocument.responses

I had this problem and at first couldn’t work out why a script was working on a test database but not the live one, then I remembered this setting in the advanced database properties. If you have “Disable specialized response hierarchy information” checked it will cause NotesDocument.Responses to return 0. The context sensitive help neglects to mention this but the full topic does:

"By default every document stores information that associates it with a parent document or a response document. Only the @functions @AllChildren and @AllDescendants, which are often used in view selection and replication formulas, use this stored information. Maintaining this information has a significant, negative effect on database performance.

To improve database performance, disable the response hierarchy information in databases that don’t use these @functions by selecting the Advanced database property “Don’t support specialized response hierarchy.”

Disabling the response hierarchy information has no effect on views and replication formulas that display information hierarchically without using @AllChildren and @AllDescendants.

Disabling the response hierarchy information sets NotesDocument.Responses to 0 documents.

If you select or deselect the “Don’t support specialized response hierarchy” property, you must compact the database so that the setting takes effect. Compacting in this case makes a temporary copy of the database, so your system must have the disk space to make the copy."