简体   繁体   中英

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

在此处输入图像描述

ODBC x64

在此处输入图像描述

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  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM