Informix Error -6002: Tried to open more than one database.
Cause and resolution
Tried to open more than one database.
The program has called dbselect() twice in succession passing the DBOPEN flag. The program must call dbselect() with the DBCLOSE flag to close a database before it opens another database.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-6002 fires when dbselect() is called a second time with the DBOPEN flag while a database is
already open — per the archived catalogue, dbselect() must be called with DBCLOSE first.
- A second
dbselect(..., DBOPEN)call without an interveningDBCLOSE, per the archived catalogue — the direct, only cause.
Solutions / Resolution
- Call
dbselect()with theDBCLOSEflag to close the current database before opening another, per the archived catalogue.
Examples
N/A
No specific triggering statement is documented beyond the function-level condition described above.
Diagnostic Checks
- Confirm every
dbselect(..., DBOPEN)call is paired with aDBCLOSEbefore the next one.
Related Errors / Related Topics
- -6000 — "Tried to perform an operation on an unopened table or database. Database not yet opened."
- -6025 — "The table is already open."
Close the current database with dbselect(..., DBCLOSE) before opening another one.