Bug #121927 Unable to delete records containing NULL values in Microsoft Access using MySQL Connector/ODBC 9.4

Submitted: 25 Nov 16:43 Modified: 25 Nov 17:07
Reporter: Silke Taylor Email Updates:
Status: Open Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:9.4 OS:Windows
Assigned to: CPU Architecture:x86

[25 Nov 16:43] Silke Taylor
Description:
# Unable to delete records containing NULL values in Microsoft Access using MySQL Connector/ODBC 9.4

## Description

We are experiencing an issue when attempting to delete records from a MySQL-linked table in Microsoft Access using MySQL Connector/ODBC 9.4.

Microsoft Access serves as a data-entry front end for our MySQL database. When a user attempts to manually delete a record containing NULL values in one or more columns, the operation fails with the following error:

```
ODBC--delete on a linked table failed.

[MySQL][ODBC 9.4(a) Driver][mysqld-8.4.9]
The number of attributes is larger than the number of attribute values provided. (#0)
```

## Environment

- MySQL Server: 8.4.9
- MySQL Connector/ODBC: 9.4 (ANSI driver)
- Client application: Microsoft Access
- Operating system: Windows
- Connection method: ODBC-linked tables

## Steps to reproduce

1. Create a MySQL table containing a primary key and several nullable columns.
2. Insert a record containing NULL values in one or more columns.
3. Configure an ODBC data source using the MySQL Connector/ODBC 9.4 ANSI driver.
4. Link the MySQL table in Microsoft Access using the ODBC data source.
5. Open the linked table in Microsoft Access.
6. Select the record containing NULL values and attempt to delete it.
7. Confirm the deletion.

## Expected behavior

The record should be successfully deleted from the MySQL database regardless of whether it contains NULL values in nullable columns.

## Actual behavior

Microsoft Access reports an ODBC error, stating that the number of attributes is larger than the number of attribute values provided. The deletion fails.

## Troubleshooting performed

We tested the following connection parameters, which are recommended in the MySQL Connector/ODBC documentation for improved DELETE queries in Microsoft Access:

```
FOUND_ROWS=1;DYNAMIC_CURSOR=1;
```

However, enabling these options did not resolve the issue.

We are currently investigating whether using an explicit DELETE statement through an Access pass-through query or downgrading the ODBC connector provides a reliable workaround.

## Related bug reports

The issue appears to be similar to several previously reported bugs:

- Bug #116442: https://bugs.mysql.com/bug.php?id=116442
- Bug #118489: https://bugs.mysql.com/bug.php?id=118489
- Bug #120484: https://bugs.mysql.com/bug.php?id=120484

Although Bug #116442 indicates that a related issue was fixed in Connector/ODBC 9.1.0, we are still experiencing this behavior with Connector/ODBC 9.4.

## Questions

- Is this a regression or an unresolved issue in MySQL Connector/ODBC?
- Is there a recommended connection parameter or configuration that resolves this issue?
- Is there a version of Connector/ODBC that reliably supports deleting records containing NULL values from Microsoft Access linked tables while remaining compatible with MySQL Server 8.4?
- Is a permanent fix planned?

## Impact

This issue prevents users from performing routine record deletions through the Microsoft Access interface. Requiring users to execute SQL statements manually is not a practical long-term solution for our nontechnical database users.

How to repeat:
1. Create a MySQL table containing a primary key and several nullable columns.
2. Insert a record containing NULL values in one or more columns.
3. Configure an ODBC data source using the MySQL Connector/ODBC 9.4 ANSI driver.
4. Link the MySQL table in Microsoft Access using the ODBC data source.
5. Open the linked table in Microsoft Access.
6. Select the record containing NULL values and attempt to delete it.
7. Confirm the deletion.
[25 Nov 17:07] Silke Taylor
I verified the installed Microsoft Visual C++ Redistributable versions. Both the x86 and x64 versions are 14.50.35719.0, which exceeds the minimum required version of 14.40.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.