PANIC: LookupHandle: null handle : error message when opening a database

Hi !

We are currently using Notes 5 but will soon to migrate to R6.5.

I have a database designed for R5 that cannot be opened by a client with R6.6. We obtain the

“PANIC: LookupHandle: null handle” red message.

I have try to debug but the error appear before the debug can do anything.

As there is a PostOpen script, I suppose this may be the cause. If yes, I can only update it with R5.

Here is the PostOpen database event code:

Sub Postopen(Source As Notesuidatabase)

Dim db As NotesDatabase

Dim wks As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim eval As Variant

Set db = Source.Database

eval = Evaluate("@Name([CN];@Username)")

If ( db.Server = "" And Not(eval(0)="Daniela Invernici")) Then

	Messagebox( "The database must not be browsed on local." )

	Set uidoc = wks.EditProfile("CloseWindow")

	uidoc.Close

Else

	Call wks.OpenFrameset("MainFrameset")

End If

End Sub

Any idea ? Am I in the good direction ?

Thank you for any tips!

Subject: RE: PANIC: LookupHandle: null handle : error message when opening a database

It seems likely that the Postopen event is causing the problem. The code there doesn’t look suspicious, but it opens other windows, so perhaps something in one of those other windows is causing the problem.

Even if you get an error opening the database in the Notes client, you should be able to open it in Domino Designer without an error, since the Postopen code doesn’t execute in that case. That should let you edit the code.

I suggest you open the database with the LotusScript debugger active, so that you can see which line causes the problem. If it doesn’t happen with the debugger running, try a Recompile All LotusScript – that might fix the problem.

Why do you use Evaluate to find out the username instead of NotesSession.Username? NotesName class will let you get the common name. Don’t know if this has anything to do with your problem, but it might.

Subject: RE: PANIC: LookupHandle: null handle : error message when opening a database

Thank you André.I tried to debug when opening the database but the crash happens before the debug shows anything. I am wondering if this crash is not happening before the PostOpen event arrives.

Thanks for you suggestion regarding Evaluate, I will check that.