[Wine] WINE not communicating with unixODBC

Razorwings18 wineforum-user at winehq.org
Fri Apr 16 13:06:49 CDT 2010

In a Debian Lenny I've installed WINE 1.1.35, unixODBC (plus unixODBC-bin and -dev), libmyodbc.

PROBLEM: Drivers (or DSNs) set up in unixODBC (via /etc/odbcinst.ini) do not work. Connection cannot be established from VB6 application, and drivers do not show in the WINE ODBC Control Panel -> Drivers tab.
Testing the connection using $ isql DSNNAME works perfectly.
Trying to connect (to MySQL of course) from WINE using the VB6 application either via a DSN or DSN-less connection gives the same result - error: "Provider cannot be found. It may not be properly installed"

NOTICE!!: Following the same steps for unixODBC, libmyodbc and setup procedure works FLAWLESSLY in the TESTING server. This is the PRODUCTION server.

* Starting with a properly installed WINE 1.1.35 - apps in it are connecting to an MSSQL 2000 properly using OLE DB DSN-Less connections.
odbc32 is properly set to INTERNAL in the LIBRARIES tab of WINECFG.

1. Installed the current MySQL Connector/ODBC for Windows from WINE ($ wine msiexec /i mysql-connector-odbc-5.1.6-win32.msi)
2. Installed unixODBC, libmyodbc (unixODBC unixODBC-bin unixODBC-dev libmyodbc via Synaptic)
3. Set up the ODBC Driver within unixODBC
--- Edit /etc/odbcinst.ini


[{MySQL ODBC 5.1 Driver}]
Description = {MySQL ODBC 5.1 Driver}
Driver = /usr/lib/odbc/libmyodbc.so
UsageCount = 1

4. Run the VB6 app. Code:


Private oConn As ADODB.Connection
Private IPServidor As String
Private NombreBase As String

Private Sub Command1_Click()
    Dim oRS As ADODB.Recordset
    Set oConn = New ADODB.Connection
    oConn.CursorLocation = adUseClient
    oConn.Open "Driver={MySQL ODBC 5.1 Driver};" & _
           "Server=;" & _
           "Port=3306;" & _
           "Option=131072;" & _
           "Stmt=;" & _
           "Database=mydatabase_dbo;" & _
           "Uid=root;" & _
    Set oRS = New ADODB.Recordset

    MsgBox oRS.Fields(1)
    Set oRS = Nothing
    Set oConn = Nothing
End Sub

IT WORKS IN TESTING: As I said, following these steps in the TESTING server worked perfectly. Whatsmore, all unixODBC drivers I set up there for testing purposes (by changing the Driver name in odbcinst.ini) appear in the DRIVERS tab of the WINE ODBC Control Panel ($~>wine control). This does not happen in PRODUCTION.
The only apparent difference between TESTING and PRODUCTION is that TESTING is i386 while PRODUCTION is AMD64. Other than that, TESTING has FreeTDS installed (from back when I was trying to use unixODBC to connect to MSSQL) while PRODUCTION doesn't.
All other libraries seem to be the same version in both servers.

When the app is executed via WINE, the following debug information is displayed in PRODUCTION, different from what is displayed in TESTING:


err:ole:apartment_getclassobject DllGetClassObject returned error 0x80004005
err:ole:create_server class {c8b522cb-5cf3-11ce-ade5-00aa0044773d} not registered
fixme:ole:CoGetClassObject CLSCTX_REMOTE_SERVER not supported
err:ole:CoGetClassObject no class object {c8b522cb-5cf3-11ce-ade5-00aa0044773d} could be created for context 0x17

MY THOUGHTS: I really feel this is a problem with WINE having problems linking to unixODBC. I know it supposedly uses /usr/lib/libodbc.so to do this. I have checked that the file is in place (it's actually a link to libodbc.so.1.0.0 ) and for differences with TESTING. I found none.

Any help will be appreciated. I've been scratching my head so hard, I've reached the cortex.

(Please do not suggest I update WINE - First, because it IS working fine on TESTING under 1.1.35, and more importantly, because PRODUCTION is working perfectly as it is. I don't want to risk things going south on me over this.)

More information about the wine-users mailing list