Bug #116442 Unable to Delete Row Manually in Linked Table with Empty Values in Microsoft Acc
Submitted: 22 Oct 7:48 Modified: 13 Nov 12:25
Reporter: Aalekh Ingole Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:8.4 and 9.0 OS:Windows
Assigned to: Rafal Somla CPU Architecture:Any

[22 Oct 7:48] Aalekh Ingole
Description:
When a table is linked to a MySQL server through Microsoft Access using the MySQL ODBC Connector 8.4, it is not possible to manually delete a row if the row contains an empty value in any one or more fields. However, deleting the same row using an ad hoc query through the query design feature in Access works correctly.

Error Message - 
ODBC - delete in a linked table ‘table_test’ failed.
[MySQL][ODBC 8.4(w) Driver][mysqld-9.0.33-commercial] The number of attributes is larger than the number of attribute values provided (#0)

Impact:
This bug affects the ability to manage data directly through the linked table interface in Access, requiring users to resort to using queries for deletion operations, which may not be intuitive for all users. This can disrupt workflow efficiency and increase the complexity for users who are not familiar with writing SQL queries.

Additional Information:
- The issue does not occur when all fields in the row contain non-empty values.

Please investigate this issue as it affects basic data manipulation tasks in a linked table setup. If further information is needed, feel free to contact me.

How to repeat:
Steps to Reproduce:
1. Create a table in MySQL with multiple fields.
    Example schema:
    Sql →

    CREATE TABLE test_table (
        id INT PRIMARY KEY,
        name VARCHAR(100),
        email VARCHAR(100),
        phone VARCHAR(20)
    );
`

2. Insert one or more rows where at least one field has an empty value.
     Example data:
     Sql →

    INSERT INTO test_table (id, name, email, phone) VALUES
    (1, 'John Doe', 'john.doe@example.com', ''),
    (2, 'Jane Smith', '', '123-456-7890');
    ```

3. Link this table to Microsoft Access using the MySQL ODBC Connector 8.4:
    - Open Microsoft Access.
    - Go to External Data -> New Data Source -> From Other Sources -> ODBC Database.
    - Select "Link to the data source by creating a linked table".
    - Choose the MySQL ODBC Connector 8.4 and provide the connection details.
    - Select the `test_table` to link.

4. Open the linked table in Access.

5. Attempt to manually delete a row that contains an empty value in one or more fields:
    - Select the row by clicking the row selector (leftmost column).
    - Press the Delete key or right-click and select "Delete Record".

Expected Result:
The row should be deleted successfully when attempting to delete it manually in the linked table view.

Actual Result:
An error occurs, and the row is not deleted when attempting to delete it manually in the linked table view. 
The error message received is:
[22 Oct 10:13] MySQL Verification Team
Hi Mr. Ingole,

Thank you for your bug report.

We suppose that the error message that you receive is:

"
ODBC - delete in a linked table ‘table_test’ failed.
[MySQL][ODBC 8.4(w) Driver][mysqld-9.0.33-commercial] The number of attributes is larger than the number of attribute values provided (#0)

"

Please, let us know if the same issue occurs if you do not specify empty strings for the VARCHAR columns. Try  to specify some string instead of the empty value.

Next, please let us know the exact version of Windows OS that you are using and exact version of MS Access.

We need those data in order to try to reproduce the issue.

We are waiting on your feedback.
[22 Oct 10:26] MySQL Verification Team
Hi Mr. Ingole,

it turns out that the bug that you reported is already fixed in 9.1.0.

The original bug is:

https://bugs.mysql.com/bug.php?id=115584

Can you please try 9.1.0. It should work.

That patch can not be ported back to 8.4 and 9.0.

Thanks in advance .......
[25 Oct 3:34] Aalekh Ingole
Hi Team,

While setting up the ODBC connection with version 9.1,ODBC Driver crashes.

If you try to establish external data connection using MS-ACCESS using ODBC driver 9.1 the parent application which is MS-ACCESS also crashes.
[25 Oct 3:35] Aalekh Ingole
Hi Team,

While setting up the ODBC connection with version 9.1,ODBC Driver crashes.

If you try to establish external data connection using MS-ACCESS using ODBC driver 9.1 the parent application which is MS-ACCESS also crashes.
[25 Oct 9:31] MySQL Verification Team
Hi Mr. Ingole,

Thank you for the info.

However, what we need is a fully repeatable test case, so that we can try to get the same error.

We do not have problems on connecting to MS Access with C/ODBC 9.1.

Hence, we need all details .......
[28 Oct 6:13] Bogdan Degtyariov
Hi Mr. Ingole,

As Sinisa has pointed out we are unable to repeat the problem with the crash in MS Access.
This is an essential step to fix the issue if it is inside the driver.

Recently we became aware of the ODBC Driver 9.1 crashes caused by runtime libraries inside Visual C++ Redistributable package 2015-2022 version 14.36. Updating the VC++ package to version 14.40 (the most recent at this moment) resolved the problem with the crashes. Please try this and let us know if it worked.

If after updating VC++ package to 14.40 you are still having the crashes please send us the memory mini dump produced by Windows upon the crash. The instructions on how to enable the memory dump and where to find the file can be found on Microsoft Learn portal:

https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/generate-a-kerne...

Thanks.
[29 Oct 10:01] MySQL Verification Team
Thank you, Bogdan.
[13 Nov 10:54] MySQL Verification Team
Hi Mr. Ingole,

Thank you for your feedback.

However, we can not repeat your bug report.

In order to repeat it we require a full test case, including all SQL statements that cause the problem that you are reporting.

We can not continue until we get a full test case.

Can't repeat.
[13 Nov 10:59] Bogdan Degtyariov
In addition to what Sinisa said I would like to point out that memory dumps can be generated for application crashes too, not only when Windows crashes.
[13 Nov 11:50] MySQL Verification Team
Thank you, Bogdan.
[13 Nov 12:25] Aalekh Ingole
Hi Team, 

Steps to recreate the bug are as below.

Open 64 Bit odbc drivers
select System DSN
Add a new data source
Enter TCIP server 
Enter username and Password (can be rubbish - its just a function test)
Press test OR even just try to select database in the drop down box
The odbc box instantly dies!
[13 Nov 13:01] MySQL Verification Team
Hi Mr. Ingole,

Are you using C/ODBC 8.4.3 ????

Also, can you set ODBC to debug mode  and can you upload the error log ???

What are exactly the versions and releases of Windows and MS Access ???

Thank you in advance ......