Tried wine-2.9, wine-3.0 and wine-staging-3.18
About a year ago I got my VB6 program to connect to a local MariaDB server using mysql-connector-odbc-5.3.6-win32.msi in Linux using wine. Now when I try to do the same, it fails:
I wrote a minimal reproducible test case and I have great hopes that someone succeeds in getting the ADODB.Connection ".Open" call to succeed, and can steer me in the right direction.Method '~' of object '~' failed
Note: You do not need to have an actual MariaDB server running to test this. The challenge here is to get the "cn.Open" call to not fail with "Method '~' of object '~' failed". If whatever is causing this problem is solved, opening the connection if MariaDB is not running will fail with "[MySQL][ODBC 5.3(w) Driver]Can't connect to MySQL server on 'localhost' (10061)" which would be a tremendous success.
Step 1: Download winetricks:
Code: Select all
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
https://downloads.mysql.com/archives/ge ... -win32.msi
Step 3: Set up a wine prefix:
Code: Select all
WINEARCH="win32" WINEPREFIX="$HOME/wine-ado" ./winetricks vb6run mdac28
WINEARCH="win32" WINEPREFIX="$HOME/wine-ado" wine msiexec /i mysql-connector-odbc-5.3.6-win32.msi
Code: Select all
WINEARCH="win32" WINEPREFIX="$HOME/wine-ado" wine control
Note that you do not have to create a new data source, it's enough that the MySQL ODBC 5.3 Unicode driver is visible there.
https://dev.mysql.com/doc/connector-odb ... t-dsn.html
Step 5: Download the source code/program:
https://filebin.net/vb1di59a65oxvsb1/ad ... t=icqv1naa
https://filebin.net/vb1di59a65oxvsb1/ad ... t=icqv1naa
I bundled two versions of the program; one uses late binding (Dim cn As Object), and the other uses early binding (Dim cn As ADODB.Connection) and as such has a reference to "Microsoft ActiveX Data Objects 2.8 Library" and the installer bundles MDAC_TYP.EXE
The zip files include compiled binaries, but you can compile yourself if you like.
Step 6: Run
Early-bound:
Code: Select all
WINEARCH="win32" WINEPREFIX="$HOME/wine-ado" wine adotest_early/bin/adotest_early.exe
Code: Select all
WINEARCH="win32" WINEPREFIX="$HOME/wine-ado" wine adotest_late/bin/adotest_late.exe
See attached image "Success".
Failure would present itself as a "Method '~' of object '~' failed" popup.
See attached image "Failure".
I spent three days digging through the web, following dead links, dead ends and off-topic advice. I tried having the VB6 installer install MDAC_TYP.EXE, and having it not do that. I tried registering msado15.dll:
Code: Select all
WINEARCH="win32" WINEPREFIX="$HOME/wine-ado" wine regsvr32 /i msado15.dll
regsvr32: Successfully registered DLL 'msado15.dll'
regsvr32: 'DllInstall' not implemented in DLL 'msado15.dll'