64-bit database cannot be connected from IIS

When connecting with a 64-bit database (such as informix, ASE etc.) from the PowerServer Web APIs that runs in the same process as its IIS worker process (in-process hosting), the following error occurs:

ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

Cause:

A 32-bit (x86) self-contained deployment published with a 32-bit SDK that uses the in-process hosting model requires that the Application Pool is enabled for 32-bit; while a 64-bit (x64) self-contained deployment that uses the in-process hosting model requires that the Application Pool is disabled for 32-bit.

By default, the Application Pool is enabled for 32-bit.

Solution:

When using a 64-bit database, disable the Application Pool for 32-bit.

To do so, in IIS Manager, navigate to Application Pools in the Connections sidebar. Select the app's application pool. In the Actions sidebar, select Advanced Settings. Set Enable 32-Bit Applications to False.