Bug #11863 MyODBC won't open DAO connection with new Windows Update
Submitted: 11 Jul 2005 15:20 Modified: 8 Sep 2005 7:49
Reporter: B.J. Nolletti Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.11 OS:Windows (Windows 2000)
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: ODBC5-RC

[11 Jul 2005 15:20] B.J. Nolletti
Description:
I sent a bug report in last week #11818 and have some additional information for you.  

This problem occurs after installing the "Update Rollup 1 for Windows 2000 SP4".  This update is not yet included in the Automatic Updates but according to the update's FAQ it will be included sometime in early July (which is here).

When opening a DAO 3.6 connection from Visual Basic 6 I receive the following error:
   "test.exe has generated errors and will be closed by Windows.  You will need to restart the program.  An error log is being created."
The error in the Dr Watson log is "Exception number: c00000005 (access violation)"

I noticed this problem using MySQL database version 4.0.12.  I tried installing 4.1.12a and the problem remains.

How to repeat:
I have only tested this with a compiled version of this example program.  I didn't want to install the update on my development machine.  Here is VB6 code to generate the error.  Be sure to add a reference to Microsoft DAO 3.6 Object Library.

    Dim ws As DAO.Workspace
    Set ws = DBEngine.Workspaces(0)

    Dim db As DAO.Database
    
    '*** Will Crash On The Following Line ***
    Set db = ws.OpenDatabase("MyODBCTest", _
        dbDriverNoPrompt, False, _
        "ODBC;DATABASE=test;UID=test;PWD=test;DSN=MyODBCTest")
    
    MsgBox "Database open successfully"
    
    db.Close
    Set db = Nothing
    ws.Close
    Set ws = Nothing

A second way to observe this problem is in MS Access.  I have MS Office 2000 Premium installed.  Try to link to a table using MyODBC.  After selecting the DSN the link screen closes.  It does not prompt you to select tables for linking.  There is no error message.  

Suggested fix:
I haven't downloaded the code for MyODBC to try to locate the problem.  If you need any more information from me please feel free to contact me at bnolletti[at]dbsinet[dot]com.  Thanks.
[12 Jul 2005 11:16] Vasily Kishkin
I was able to reproduce the bug on Excel.
Tested on Win 2000 Sp4 , MyODBC 3.51.11, MySQL 4.1.13
[8 Sep 2005 7:49] Bogdan Degtyariov
Seems the problem is in Microsoft Jet Engine Library (msjet40.dll) version 4.0.9025.0
This version causes the error in Access. I tried older versions 4.0.8015.0, 4.0.7328.0, they worked without problems. Also I analyzed driver calls log (myodbc3.log) and have found that Access crashes after MyODBC driver returned correct result.
So, we can suggest it would be better to replace msjet40.dll 4.0.9025.0 by older version (4.0.8015.0 or 4.0.7328.0).

To do this you need:
1. Find proper version of msjet40.dll in Windows folder and its subfolders. File search will find several files, so please check the version in Properties/Version dialog.
2. Current version of msjet40.dll is located in Windows/system32 directory. It is protected by Windows file protection. Therefore msjet40.dll in Windows/system32/dllcache directory and Windows/system32 directory should be replaced.

After the replacement of msjet40.dll my Access worked well.