03-08-2022 05:59 PM
I had the following error in my code, using LabWindows/CVI Full Development System 2017:
Error Msg: NON-FATAL RUN-TIME ERROR: "REMAP.C", line 1303, col 12, thread id 18848: Function DBConnect: (return value == -10 [0xfffffff6]). Native error code -2147467259 0x80004005 Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
Code: hdbc = DBConnect("DSN=PARAMETRIC;UID=SPC;PWD=onlinespc;DLG=2");
I am on Windows 10 Pro Version 21H2.
Thank you for your help!
03-10-2022 03:38 AM
When using ODBC drivers you need to watch out for 32-bit and 64-bit differences. On any 64-bit system running the ODBC Admin tool from the Start menu will start the 64-bit version of that tool which will configure DSN connections using 64-bit ODBC drivers. When you then try to open a connection from a 32-bit application, the 32-bit ODBC manager tries to load the 64-bit driver and that can't work.
Instead you need to explicitly open the 32-bit ODBC Admin tool in C:\Windows\SysWOW64\odbcad32.exe to configure 32-bit DSNs.