Search code examples
mysqlodbc64-bit32-bit

What is the correct way to connect MySQL ODBC to a 32bit in VBScript on machine Windows10 64bit?


I've recently installed MySQL Community Server on Windows 10 x64.

Now, one of my scripts VBScript that uses an ODBC connection 32bit no longer work.

But the ODBC same Driver working correctly on Microsoft Visual Studio Professional 2013.

ODBC x86

enter image description here

ODBC x64

enter image description here

The error is:

Error 1918. Error installing ODBC driver MySQL ODBC
 5.3 ANSI Driver, ODBC error 13: The setup routines for
 the MySQL ODBC 5.3 ANSI Driver ODBC driver could
 not be loaded due to system error code 126: The
 specified module could not be found. ...\myodbc5S.dll...

I have tried this suggestion without success.

My code below.

   Start_Time = Timer   

   Set cn = CreateObject("ADODB.Connection")
   cn.Open "DRIVER={MySQL ODBC 5.3 ANSI Driver};SERVER=XXX;PORT=3306;DATABASE=XXX;USER=XXX;PASSWORD=XXX;OPTION=3;" 
   cn.CommandTimeout = 10000 

   cn.Close()
   Set cn = Nothing     

   End_Time = Timer
   Total_Time = FormatNumber(End_Time - Start_Time, 2) 

   If Err.Number <> 0 Then
      MsgBox(Date() & vbcrlf & " " & Err.Number & vbcrlf & Err.Description)  
   Else   
      CreateObject("WScript.Shell").Popup "OK! " & vbcrlf & Now() & vbcrlf & "Total Time : " & Total_Time, 10, "OK"           
   END If 
   On Error GoTo 0  

   WScript.Quit  

Solution

  • Error 1918. Error installing ODBC Driver MySQL ODBC 5.3 ANSI Driver