Informix Error -11310: Create and Drop database must be executed within a ServerOnly connection.
Cause and resolution
Create and Drop database must be executed within a ServerOnly connection.
This Informix ODBC error code is the same as SQLSTATE value S1000. The following function can return this error code: SQLPrepare.
Change your CONNECTDATABASE option to YES in the connect string for SQLDriverConnect or remove this option from the connect string, as default value of CONNECTDATABASE is YES.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11310 fires when CREATE DATABASE/DROP DATABASE is prepared on a connection that isn't
server-only — per the official guidance, this is the same as SQLSTATE value S1000,
returnable by SQLPrepare.
- The connect string's
CONNECTDATABASEoption not set correctly for a ServerOnly connection, per the official guidance.
Solutions / Resolution
- Change
CONNECTDATABASEtoYESin the connect string forSQLDriverConnect, or remove the option entirely (its default isYES), per the official guidance — quoted as written; the source's own wording doesn't further explain whyYES, the default, fixes aServerOnly-connection requirement.
Examples
N/A
No specific triggering statement is documented beyond preparing CREATE/DROP DATABASE on a database-bound connection.
Diagnostic Checks
- Check the
CONNECTDATABASEoption in the connect string, and set it appropriately for a server-only connection before preparing CREATE/DROP DATABASE.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11310 in this set yet.
CREATE/DROP DATABASE was prepared on a non-server-only connection — set
CONNECTDATABASE for a server-only connection first.