Informix Error -6000: Tried to perform an operation on an unopened table or database. Database not yet opened.
Cause and resolution
Tried to perform an operation on an unopened table or database. Database not yet opened.
Before a program can access data, it must use the dbselect() function to select a database and then a table. Review the program logic to see why these calls were not made.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-6000 fires when a program calls an ALL-library function before selecting a database and table —
per the archived catalogue, dbselect() must run first to establish both before any other call
can access data.
- A data-access function called before
dbselect(), per the archived catalogue — the direct, only cause.
Solutions / Resolution
- Call
dbselect()to open the target database and table before any other ALL-library call, per the archived catalogue. - Review the program's call order if this fires unexpectedly — a missing or reordered
dbselect()call is the usual explanation.
Examples
N/A
No specific triggering statement is documented beyond the function-level condition described above.
Diagnostic Checks
- Confirm
dbselect()runs, and succeeds, before any other ALL-library call in the program.
Related Errors / Related Topics
- -6001 — "The database or table does not exist."
- -6002 — "Tried to open more than one database."
- -6004 — "No database open."
Call dbselect() to open the database and table before any other ALL-library function — this fires when that ordering is skipped.