IBM Support

CLI0199E - "Invalid connection string attribute" when running CLI/ODBC application



An application could fail with a CLI0199E - "Invalid connection string attribute." error after migrating from a DB2 v8 client to a DB2 v9.5+ client.


The application is using a connection string that either contains an invalid DB2 CLI keyword or a combination of keywords that are incompatible with each other.

DB2 lists its set of supported ODBC/CLI keywords in its corresponding documentation for v9.5, v9.7, v10.1 and v10.5.

If the keyword is not supported then the CLI/ODBC driver can return that error message.

There are two ways of connecting to a database with a CLI application in DB2. One is to use a data source name (or DSN) and the other is to use a DSN-less connection which requires using keywords such as HOSTNAME, PORT (or SERVICENAME), DATABASE, and PROTOCOL. The DSN-less mechanism allows you to connect to the database without the need of a data source name.

The DB2 CLI driver no longer allows a combination of both keywords and that could result in this error as well. For example if the connection string contained both DSN and HOSTNAME or both DSN and SERVICENAME it could return the "Invalid connection string attribute" error message as well.

Resolving The Problem

Modifying the application by removing unnecessary keywords from the connection string should resolve the problem.

[{"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Programming Interface - CLI","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;9.5;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018