title: IBM DB2 ODBC driver 64bit fails to load
body: <p>When I try to connect to the DB2 database with the 64bit DB2 ODBC driver, the API call fails. With 32bit driver its fine.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>TCHAR dsn[] = _T("DSN=ODBCDB2"), connStringOut[100] = _T("");
  SQLSMALLINT connStringOutSize = 0;
  SQLRETURN rc = SQLDriverConnect(connHandle, NULL, (SQLTCHAR *)dsn, _tcslen(dsn), connStringOut, sizeof(connStringOut) / sizeof(TCHAR), &amp;connStringOutSize, SQL_DRIVER_NOPROMPT);
  
  //rc = -1
  //Error message: Specified driver could not be loaded due to system error  1114: A dynamic link library (DLL) initialization routine failed. (IBM DB2 ODBC DRIVER - DB2COPY1, C:\PROGRA~1\IBM\SQLLIB\BIN\DB2CLIO.DLL)
  </code></pre>
  
  <blockquote>
    <p>Environment Details:</p>
    
    <ul>
    <li>IBM DB2 v11.5.0.1077</li>
    <li>IBM DB2 ODBC Driver v11.5.0.1077 (32-bit)</li>
    <li>ODBC v3.8</li>
    <li>VC++ (Visual Studio 2017)</li>
    <li>Windows 10 64-bit</li>
    </ul>
  </blockquote>
  
  <p>Any help is much appreciated. Thanks!</p>