Informix Error -11017: Connection not open.
Cause and resolution
Connection not open.
This Informix CLI error code is the same as SQLSTATE value 08003. The following functions can return this error code: SQLAllocStmt(), SQLDisconnect(), SQLGetConnectOption(), SQLGetInfo(), SQLNativeSql(), SQLSetConnectOption(), and SQLTransact().
The connection that the hdbc argument specifies is not open. Validate that the SQLConnect, SQLDriverConnect, or SQLBrowseConnect calls succeeded.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11017 fires when a function is called with a connection handle (hdbc) that isn't open —
per the official guidance, this is the same as SQLSTATE value 08003, returnable by
SQLAllocStmt(), SQLDisconnect(), SQLGetConnectOption(), SQLGetInfo(),
SQLNativeSql(), SQLSetConnectOption(), and SQLTransact().
- The connection the
hdbcargument specifies not being open, per the official guidance — the direct, only cause.
Solutions / Resolution
- Validate that
SQLConnect(),SQLDriverConnect(), orSQLBrowseConnect()actually succeeded before using the handle, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond using an unopened connection handle.
Diagnostic Checks
- Check the return code of the connect call (
SQLConnect()/SQLDriverConnect()/SQLBrowseConnect()) before usinghdbcin any subsequent function.
Related Errors / Related Topics
- -11002 — "Disconnect error." A related connection-lifecycle error, about a warning during a successful disconnect rather than using a never-opened handle.
- -11015 — "Unable to connect to data source." A related connection-establishment error, about the connect call itself failing.
- -11016 — "Connection in use." A related connection-establishment error, about an exclusive-use conflict rather than an unopened handle.
- -11018 — "Data source rejected establishment of connection." A related connection-establishment error, about an explicit rejection.
A function was called with a connection handle that was never successfully opened — validate the connect call's return code first.