Database has not been opened - force open

In a LS button I am getting an error that the database has not been opened. In this case, that may well be true so how can you force an open? I am trying to open a user’s mail archive and copy the contents back into the mail file. A number of users probably have not opened their archive mail file. I just built in the trap/messages to see if the db is open too. Am I doing something wrong or does the user really have to literally open the file for the open to work? Or is there I can do it through script?

Dim dbProfile As NotesDatabase

Dim Profile As NotesDocument

Dim ArchFile As Variant

Set dbProfile = s.CurrentDatabase

Set Profile = dbProfile.GetProfileDocument(“Archive Profile”)

ArchFile = Profile.ArchLastRunDestDBs(0)

Call dbArchive.Open(“”, ArchFile)

Subject: Database has not been opened - force open

This message is not related to if someone has ever used a Notes client to open the database (although it sounds like it was).

The propety IsOpen only relates to the back-end NotesDatabase object. Most of the time, the reason for is open to be false, is simply because a database of that name does not exist at the path specified. You still do get a NotesDatabase object back in LS, but it is “not open”, because there is no database. Just looking at your code snippet cannot proof that of course.

There are a number of other reasons for this, but this is really the first thing to check.