Why can't I open a database directly but can open from notesdbdirectory

I am unable to open a database using session.GetDatabase( strServer, strPath ) or New NotesDatabase( strServer, strPath) but I can open it from the notesDbDirectory

Does anyone know what would cause this behavior

This code returns the message at the bottom of the screen “Could not open the database” which means that it opened the database using notesDbDirectory but not get database

Set Directory = New Notesdbdirectory(“NotesSrv01”)

Set dbTarget=directory.getfirstdatabase(DATABASE)

’ Get the next database

While Not (dbTarget Is Nothing)

Call dbTarget.Open( “”,“”)

If dbTarget.FilePath = "FS\FSS.nsf" Then

  strServer = dbTarget.Server 

  strPath = dbTarget.FilePath 

  Set dbSecond = session.GetDatabase( strServer, strPath )

  If dbSecond.IsOpen Then

    Messagebox "The database opened", 0, "OPEN"

  Else

    Call dbSecond.Open( "", "" )

    If dbSecond.IsOpen Then

      Messagebox "The database opened 2nd", 0, "OPEN"

    Else

      Print "Could not open the database" 

      Exit Sub

    End If

  End If

End If

PostError:

TotalCount = TotalCount + 1 

Set dbTarget = directory.getnextdatabase 

Wend

Subject: RE: Why can’t I open a database directly but can open from notesdbdirectory

NotesDBDirectory does not “open” the database. It returns you some information about the database – title, filepath, maybe one or two other things – but if you tested, you would find that dbTarget.isOpen is False.

That said, if you don’t have access to a database you can get a little information about it via NotesDBDirectory that you can’t get by inquiring for it by filename. That’s just how it is…

If you need to, you could always write a function that takes a filename as argument, creates a NotesDBDirectory, zips thru the list of databases and returns the one that has that filename.