Call uidb.close doesn't work in Postopen event in DB Script

Code as below:

Sub Postopen(Source As Notesuidatabase)

Call Source.Close

End Sub

Subject: Call uidb.close doesn’t work in Postopen event in DB Script

it may be already closed (in memory it is equivalent to terminated) but the window on the screen is still visibleit would be interesting to see if a database action (a manual agent for instance) cold be executed without re-opening it

Subject: It just ignored ‘call uidb.close’

and open the database, any actions work as usual.

Subject: RE: It just ignored ‘call uidb.close’

Add some code whose effects are very visible, e.g. Msgbox. I suspect your code is not executing at all.

I have observed with this version of Notes, that sometimes you get two copies of the database script – one you can edit and another one that executes. I don’t know how this comes about, but you should be able to fix it by deleting one or the other of the scripts. Use the NotesNoteCollection to get all the database scripts and see whether there’s only one.

Subject: RE: It just ignored ‘call uidb.close’

I have messagebox before and after ‘call uidb.close’. They all pop-up. There is only one db script. No clue why it doesn’t work.

Subject: No other ideas – call Support.

Subject: Actually I am working in my mailbox. It doesn’t work but

Created a blank database, it works.

So there must be something in mail template affecting postopen of DBscript.

Subject: *Most scripting and agents are disabled for mail.box, as I underastand it.

Subject: It’s user’s mail file instead of mail.box

Subject: RE: It’s user’s mail file instead of mail.box

I have a suspicion then. To close a database you have to close all the windows to the database. The mail file is one database that’s often open in the welcome page. Since you can’t close the welcome page, you can never actually close the mail database. Perhaps the uidb.close method is trying to close the welcome page, failing, and giving up. There might be other windows that it could close, but it won’t do it if it tries the welcome page first.

You could close the mail file by changing your welcome page to one that doesn’t show the inbox – but that’s too fancy for the close method to know how ot do.

Subject: It’s not in welcome page

I am working on a test mail DB in lab. It’s not my own mail file. So I don’t think it’s welcome page opened the inbox.

I am thinking maybe the initialize before postopen in DBScript did something …

Subject: Call uidb.close doesn’t work in Postopen event in DB Script

I have just tried at version 6.0.3 and it works OK. It is possible that you had the db open within Designer and it was therefore unable to close the database? I tried this and it allows you into the database under these circumstances.Rob

Subject: My version is 6.5.2FP1

I shutdown Notes Client totally include designer. reopen, still doesn’t work.