Calling SQLSetEnvAttr to set SQL_ATTR_CONNECTION_POOLING value.
SQLSetEnvAttr(NULL, SQL_ATTR_CONNECTION_POOLING, (SQLPOINTER)SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);
Then calling SQLDriverConnect method causes the application to hang.
SQLDriverConnect(
m_hdbc,
NULL,
sqltchConnStringIn,
SQL_NTS,
ConnStrOut,
ONE_KB_SIZE,
&cbConnStrOut,
SQL_DRIVER_NOPROMPT);
If SQLSetEnvAttr is not called to set SQL_ATTR_CONNECTION_POOLING value, then the call goes through fine and the application does not hang.
The problem occurs only on Windows/SQL 2012. The problem does not occur in Windows 2008 R2/SQL 2008 R2 environment.