If you have ever tried to open a document, run an agent, or replicate a database in HCL Notes (formerly IBM Lotus Notes) and Domino, you have probably run into this exact message: “Database has not opened yet.” It is one of the most common — and most misunderstood — error messages in the entire Notes/Domino ecosystem, because it gets triggered by two completely different kinds of problems: one is a plain access/connection issue that ordinary end users hit, and the other is a coding mistake that only shows up inside LotusScript agents and applications.
In plain English: this error simply means that something (you, or a piece of LotusScript code) tried to use a database (an .nsf file) before that database was actually, successfully opened. Sometimes that is because of permissions or a broken network path. Sometimes it is because a developer’s code tried to read or write to a NotesDatabase object that was never properly opened in the first place. This guide walks through both situations and gives you a real fix for each — not just a generic “reinstall and pray” answer.
Common Causes of “Database Has Not Opened Yet” for End Users
If you are a regular Notes client user (not writing code), the error usually comes down to one of these:
- Access Control List (ACL) restrictions — your user ID, or the server ID trying to act on your behalf, does not have sufficient rights in the database’s ACL. This is especially common when accessing a database hosted on a different Domino server than the one you normally connect to.
- Incorrect or broken file path — the database has been moved, renamed, or the server’s directory structure has changed, and the client or another database is still pointing to the old path.
- Network or connectivity issues — a dropped connection, an unreachable server, or DNS/port problems between the Notes client and the Domino server can interrupt the open request mid-way.
- Corrupted or damaged .nsf file — physical database corruption, often following an unclean server shutdown, power loss, or disk issue, can leave a database in a state where it technically exists but cannot be opened cleanly.
- Local replica problems — if you are working from a local replica and the replica itself is incomplete, damaged, or mid-replication, the same error can surface.
How to Fix “Database Has Not Opened Yet” as an End User
- Check the ACL first. Ask your Domino administrator to verify your name (or your server’s name, for cross-server access) is listed in the database’s Access Control List with at least Reader access. This single check resolves the error more often than any other fix.
- Verify the server connection. In the Notes client, go to File > Preferences > Notes Ports, select the relevant port, and use the Trace option to confirm the client can actually reach the target Domino server. If the trace fails, this is a network problem, not a database problem.
- Confirm the file path. Open the database properties (right-click the bookmark icon or use File > Database > Properties) and check that the listed server and file path still match where the .nsf actually lives.
- Run Fixup and Compact on the database. If you suspect corruption, a Domino administrator can run
load fixup [databasename.nsf]followed byload compact [databasename.nsf]from the server console to repair structural damage. - Re-replicate a fresh local copy if a local replica is suspected to be the source of the problem, rather than trying to repair a partially broken one.
Why LotusScript Developers Hit “Database Has Not Opened Yet”
If you write LotusScript agents, script libraries, or form/field code, you will eventually hit this error for a more specific reason: your code created a NotesDatabase object handle but tried to use it before successfully opening it — or assumed it had opened successfully without checking. In plain terms: LotusScript lets you create the “pointer” to a database object before that database is actually open, and if your code skips the step of confirming the open succeeded, the very next method call against that object throws “Database has not opened yet.”
This typically happens in one of these situations:
- Calling
.Openon aNotesDatabaseobject but not checking whether it actually succeeded before using the object further. - Using
GetDatabaseorGetFirstDatabase/GetNextDatabasefrom aNotesDbDirectoryobject, which can return a database object that exists but is not yet open. - Passing a database handle between functions or script libraries where one branch never actually opened it (for example, an error in an earlier step that was silently swallowed).
- Trying to access a remote database on another server where the agent’s effective user lacks ACL rights — the open call fails, but the code proceeds anyway.
The LotusScript Fix: Always Check IsOpen (or the Open Return Value)
The reliable fix is simple and should be a habit in every agent that touches a NotesDatabase object: explicitly check the result of .Open, or check the .IsOpen property, before doing anything else with the object.
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.GetDatabase("ServerName/YourOrg", "path/to/database.nsf")
If db.IsOpen Then
' Safe to proceed — database is genuinely open
Dim doc As NotesDocument
Set doc = db.GetFirstDocument()
Else
If db.Open() Then
' Open succeeded this call
Dim doc2 As NotesDocument
Set doc2 = db.GetFirstDocument()
Else
' Open genuinely failed — handle gracefully instead of letting
' the next line throw "Database has not opened yet"
MsgBox "Unable to open database: " & db.Server & "!!" & db.FilePath
Exit Sub
End If
End If
The key habit here: never assume a NotesDatabase object is usable just because it was created with GetDatabase. Always confirm with IsOpen or the boolean return of Open() first. This one check eliminates the large majority of “Database has not opened yet” errors that come from custom code rather than from genuine access or network problems.
Using OpenLog to Catch This Error Before It Reaches Users
For agents and applications running unattended on a server, the cleanest long-term fix is not just handling this one error — it is logging all LotusScript errors centrally so you catch problems like this before a user reports them. The OpenNTF OpenLog application is the standard community tool for this: it is a shared script library that any Notes/Domino application can call from its error handling block to log structured error details (database, agent, line number, error text) into a central log database. Wiring “Database has not opened yet” handling into an OpenLog call instead of a bare MsgBox means administrators can spot a pattern of these errors across many databases before they pile up as user complaints.
Preventing “Database Has Not Opened Yet” Going Forward
- Standardize on checking
IsOpenor theOpen()return value in every script library and agent template you reuse across projects. - Keep ACLs documented and reviewed periodically, especially for cross-server agents and replication scenarios where the “effective user” is easy to overlook.
- Schedule regular Fixup/Compact maintenance windows on production Domino servers to catch low-level corruption early, before it surfaces as a hard-to-diagnose open failure.
- Avoid silently swallowing errors in nested function calls — an early failure that gets ignored is exactly what produces a confusing “Database has not opened yet” several lines later, far from the real cause.
Frequently Asked Questions
What does “Database has not opened yet” mean in HCL Notes?
It means something — either you as a user, or a piece of LotusScript code — tried to use a database (.nsf file) before it was actually, successfully opened. The cause can be as simple as a missing ACL entry or as specific as a LotusScript object handle that was never confirmed open.
Is “Database has not opened yet” the same error in Lotus Notes, IBM Notes, and HCL Notes?
Yes. The product has been rebranded over the years (Lotus Notes, then IBM Notes, now HCL Notes), but the underlying Domino database engine and this particular error message have remained functionally the same across versions.
How do I fix “Database has not opened yet” in a LotusScript agent?
Check the IsOpen property of your NotesDatabase object, or the boolean return value of the .Open() method, before running any further code against that object. If the open genuinely failed, handle it gracefully (log it, alert the user) instead of letting the next line throw the error.
Can a corrupted .nsf file cause this error?
Yes. Physical corruption in the .nsf file — often following an unclean server shutdown or disk issue — can prevent a database from opening cleanly even when permissions and paths are correct. Running Fixup and Compact from the Domino server console is the standard repair step.
Does this error mean my data is lost?
Not usually. In most cases this is an access, path, network, or coding issue rather than data loss. Genuine data loss from corruption is comparatively rare and is usually accompanied by additional, more specific error messages during Fixup.
You may also be interested in reading these articles about IBM/HCL Notes:
Automating Document Migration in HCL Notes with DXL Export and Import
The Power Of IBM Notes Formula Language
IBM Notes Technique – Filter the Documents on the last 15 working days
HCL Notes Trick: Retrieve Details Rows From Embedded View
HCL Notes Trick – GetAllDocumentsBy2Keys
Get All Users From The ACL Of A Notes Database
