Bug #117271 ODBC Open has "Catastrophic failure"
Submitted: 22 Jan 16:02 Modified: 23 Jan 3:43
Reporter: Rich Alford Email Updates:
Status: Need Feedback Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:9.0+ OS:Windows
Assigned to: Bogdan Degtyariov CPU Architecture:x86
Tags: ODBC Catastrophic vbscript

[22 Jan 16:02] Rich Alford
Description:
- Installed 9.2 ODBC package on WIndows 2019 and Windows 11
- Created and ADODB.Connection, then opened the connect string directly (no DSN) with a VBSCRIPT program
- Received "Catastrophic failure"
- On Windows 11, replaced ODBC libraries with debug libraries as directed in documnetation and test program tried to connect to database; i.e. it worked.
- On Windows 2029 Server, replaced ODBC libraries with debug libraries and still had "Catastrophic failure".
- All evidence indicates that it failed before even attempting an actual connect to mysql server.
- Same "Catastrophic failure" for ODBC 9.0 and 9.1

How to repeat:
1) Install mysql-connector-odbc-9.2.0-winx64.msi on Windows

2) Run the following batch file:
@echo off
setLocal EnableDelayedExpansion

:: Change directory to executable-referenced folder
setlocal                  
cd /d %~dp0

cscript //nologo "%~f0?.wsf" %*
exit /b

<job><script language="VBSCRIPT">

Set myLicConn = CreateObject("ADODB.Connection")
LICDB_CONNECT_STRING="Driver={MySQL ODBC 9.2 ANSI Driver};Server=xxxxxxxx;DATABASE=yyyyyyyy;UID=zzzzzzzzz;PASSWORD=ppppppppp"
WScript.Echo("LICDB_CONNECT_STRING=" & LICDB_CONNECT_STRING)
myLicConn.Open LICDB_CONNECT_STRING

</script></job>

3) Output should be similar to:
LICDB_CONNECT_STRING=Driver={MySQL ODBC 9.2 ANSI Driver};Server=xxxxxxxxxx;DATABASE=yyyyyyyyyy;UID=zzzzzzzzzz;PASSWORD=ppppppppppp
C:\Users\myusername\Documents\ODBC_TEST\odbcTest.bat?.wsf(16, 2) Provider: Catastrophic failure

Suggested fix:
Unknown
[23 Jan 3:43] Bogdan Degtyariov
Hi Rich,

Thank you for the detailed description of the problem and for the VB test case.

I followed the steps you indicated, but was not able to repeat the problem.
Here is the output from the batch file:

.....................

D:\Projects\bugs\117271>run_test.bat
LICDB_CONNECT_STRING=Driver={MySQL ODBC 9.2 ANSI Driver};Server=localhost;DATABASE=odbctest;UID=*******;PWD=*********;

D:\Projects\bugs\117271>

....................

The script just connected to MySQL Server and exited without errors.

However, the problem rings a bell and the script in your environment might be experiencing crash caused by runtime libraries inside Visual C++ Redistributable package 2015-2022 version 14.36. Updating the VC++ package to version 14.40 or newer should resolve the problem with the crashes. Make sure that the redistributable package for x64 architecture is updated.
Please try this and let me know if it helped.