Bug #69956 Attaching a MySQL table in MS Access fails if the table has an umlaut in name
Submitted: 7 Aug 2013 16:28 Modified: 12 Aug 2013 20:23
Reporter: Andreas Thuering Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:> 5.1.6 OS:Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: ODBC Connector, umlaut in tablename

[7 Aug 2013 16:28] Andreas Thuering
Description:
From version > 5.1.6 it is no more possible to attach a table with umlaut in its name from MS Access 2003 or 2007 (2010 not tested).

TableDefs.Append brings an error when the table contains an umlaut. 

How to repeat:
Use this code to attach a MySQL table in an MS Access application 2003 or 2007

Function CreateLinkedTables(Tablename As String, AccessDB As String, SQLDB As String, TargetUID As Variant, TargetPWD As Variant) As Boolean

        

        On Error GoTo CreateLinkedTables_Err

        

        Dim strTblName As String

        Dim strConnSource As String

        Dim strConnTarget As String

        Dim db As Database

         'Dim rs As DAO.Recordset

        Dim tbls As TableDef

        Dim tblt As TableDef

                 

        Set db = CurrentDb

        If AccessDB <> "" Then

            strTblName = Tablename

              

            strConnSource = AccessDB

            strConnSource = strConnSource & ";APP=Microsoft Access;"

            If (DoesTblExist(strTblName) = True) Then

                db.TableDefs.Delete (strTblName)

            End If

            Set tbls = db.CreateTableDef(strTblName)

            tbls.Connect = ";DATABASE=" & AccessDB

            tbls.SourceTableName = Tablename

            db.TableDefs.Append tbls

        Else

            strTblName = Tablename

            strConnTarget = "ODBC;"

            strConnTarget = strConnTarget & "DSN=" & SQLDB & ";"

            strConnTarget = strConnTarget & "UID=" & TargetUID & ";"

            strConnTarget = strConnTarget & "PWD=" & TargetPWD & ";"

            If (DoesTblExist(strTblName) = True) Then

                db.TableDefs.Delete (strTblName)

            End If

            Set tblt = db.CreateTableDef(strTblName, _

                        dbAttachSavePWD, LCase(Tablename), strConnTarget) ' weil unter Linux mysql case sensitiv ist und alle tabellennamen klein geschrieben sind

            tblt.Connect = strConnTarget

            'tblt.SourceTableName = Tablename

           

            'This statement fails if the tablename has an umlaut in its name:

            db.TableDefs.Append tblt

        End If

Suggested fix:
code change in MySQL ODBC connector
[12 Aug 2013 8:29] Bogdan Degtyariov
Hi Andreas,

Thank you for your interest in MySQL software and for reporting a problem in it.
In order to try to repeat the bug I had to modify your VB code (like removing DoesTblExist functions that are not defined, etc).

Finally, I managed to get it working and it created the table with umlaut.
Please check the screenshot.

Did you use the ANSI or UNICODE version of Connector/ODBC?
[12 Aug 2013 8:30] Bogdan Degtyariov
MS Access 2007 Screenshot

Attachment: bug_69956_screenshot.jpg (image/jpeg, text), 56.20 KiB.

[12 Aug 2013 20:22] Andreas Thuering
Hi Bogdan

Many thanks for your tests. After reading your hint with the ansi / unicode differentiation I created 2 odbc data sources and run the tests with the result that the ansi driver failed with an error and the unicode driver works absolutely fine. I tested the last 32 bit driver, version 5.2.5.
 
Sorry for causing you this work and many thanks for your precious help!

Best regards

Andy