ISOpen error

I am using the following code in my agent to test whether “Names.nsf” is opened or not.

My code:

Dim NABDB As NotesDatabase

Set NABDB = New NOtesDatabase(“”,“names.nsf”)

If NABDB Is Nothing Then

	Messagebox "NABDB is nothing"

Else

	Messagebox" NABDB is set"

End If

If NABDB.isOpen Then

Messagebox “DB is opened”

else

Messaegbox “DB is not opened”

End if

Though I used below lines

Dim NABDB As NotesDatabase

Set NABDB = New NOtesDatabase(“”,“names.nsf”) in my agent

I am gettting “DB is not opened” when chencking for IsOpen.

Could any one of you help me?

Subject: ISOpen error

change your code to something like this

Dim sess As New notessession

Dim NABDB As NotesDatabase

'Set NABDB = New NOtesDatabase(“”,“names.nsf”)

Set NABDB=sess.GetDatabase("","names.nsf")

If NABDB Is Nothing Then

	Msgbox "NABDB is nothing"

Else

	Msgbox" NABDB is set"

End If

If NABDB.isOpen Then

	Msgbox "DB is opened"

Else

	Msgbox "DB is not opened"

End If

Subject: RE: ISOpen error

What is the difference between Set NABDB = New NOtesDatabase(“”,“names.nsf”) and

Set NABDB=sess.GetDatabase(“”,“names.nsf”).

It seems to be same. Is there any functionality difference?