Bug #116442 Unable to Delete Row Manually in Linked Table with Empty Values in Microsoft Acc
Submitted: 22 Oct 2024 7:48 Modified: 22 Jan 2025 7:36
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 2024 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 2024 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 2024 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 2024 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 2024 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 2024 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.
[13 Nov 2024 10:41] Aalekh Ingole
There is no memory dump file being generated because windows doesn't crash.
its just the ODBC driver that crashes (and MS Access when you try through it).
[13 Nov 2024 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 2024 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 2024 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 2024 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 ......
[11 Dec 2024 7:17] Aalekh Ingole
Hi Team,

Below is the required info.
After installing ODBC Drive version 9.1 and having below system configuration

Windows Version

Edition	Windows 10 Enterprise
Version	22H2
Installed on	‎10/‎5/‎2021
OS build	19045.5131
Experience	Windows Feature Experience Pack 1000.19060.1000.0

Microsoft Version - Microsoft Office LTSC Professional Plus 2021

MSACCESS Version - Version 2108(Build 14332.20812)

We can create a new DSN directly from ODBC 64 windows application.
but while adding external data source to Ms Access , MS Access Crashes and closes automatically.
[11 Dec 2024 11:11] MySQL Verification Team
Hi Mr. Ingole,

We truly need what we asked for ....

We do need that you set ODBC to debug mode  and that you upload the error log.

Thanks in advance.
[23 Dec 2024 6:54] Aalekh Ingole
Hi Team, 
Please find the attached log file.

FYI
ODBC connection is created successfully when created through ODBC data Source(64Bit).

While making an connection through MS-ACCESS it fails/crashed the MS-ACCESS Application.
[3 Jan 2025 6:58] Aalekh Ingole
Hi Team,

Any update on logs shared with you?
[3 Jan 2025 22:45] Bogdan Degtyariov
Dear Mr. Ingole,

You uploaded the ODBC Trace file, which is not the same as an error log file. The Trace File confirms that the crash happens while making the following call:

MSACCESS 1ffc-1c10 ENTER SQLDriverConnectW 

This gives us very little information to continue.

The memory mini dump would be much more useful for this purpose.

Also, you did not comment on my reply regarding Visual C++ Redistributable package 2015-2022.
This could be the most crucial piece, which solves the problem all together.
[4 Jun 5:05] MySQL Verification Team
also:
https://bugs.mysql.com/bug.php?id=118489