Troubleshooting
Problem
When using SQLDriverConnect() or SQLDriverConnectW() API to establish connection to Db2 database, you may have configured a DSN for connectivity.
If you intend to use this DSN for connection, and if you also have a db2cli.ini configured with the same DSN section as in the example below, you may hit SQL0843N error.
Example:
db2cli.ini :
[SAMPLE]
DBALIAS=SAMPLE
sample code:
ret = SQLDriverConnect(dbc1, NULL, (SQLCHAR*)"dsn=sample;uid=db2inst1;pwd=*******;", SQL_NTS, outstr, 1024, &iStrOut, SQL_DRIVER_NOPROMPT);
DSN sample in above example is configured via any other available options like db2dsdriver.cfg or Microsoft ODBC Datasource administrator etc.
Using SQLDriverConnect() with this DSN may cause your application to fail with -843 error as below:
Using SQLDriverConnect() with this DSN may cause your application to fail with -843 error as below:
szErrorMsg : [IBM][CLI Driver] SQL0843N The server name does not specify an existing connection. SQLSTATE=08003
Symptom
SQLDriverConnect()/SQLDriverConnectW() API returns SQL0843N error:
SQL0843N The server name does not specify an existing connection. SQLSTATE=08003
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPDU","label":"Db2 Connect"},"ARM Category":[{"code":"a8m3p000000hBRcAAM","label":"ODBC-\u003EAPIs\/Keywords"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
More support for:
Db2 Connect
Component:
ODBC->APIs/Keywords
Software version:
All Versions
Document number:
6592153
Modified date:
30 April 2025
UID
ibm16592153
Manage My Notification Subscriptions