Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89

    Error deleting record in access

    I ran into the following error trying to delete a record from a linked table in accessfrontend access, backend mysql, tables migrated from ms sqlserver and relinked)


    Microsoft Access
    ODBC--delete on a linked table 'primanota' failed.
    x
    [MySQL][OD8C 9.1(w) number of attributes is larger than the number of attribute values provided (#0)

    Note that deleting the record from that table using mysql workbench and the query DELETE FROM Table WHERE .... works OK. I could not find any hint in internet, What can be wrong here?
    Microsoft Access
    ODBC--delete on a linked table 'primanota' failed.
    x


    [MySQL][OD8C 9.1(w) number of attributes is larger than the number of attribute values provided (#0)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Delete by what method?

    Are you able to do other edits on table?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    Using the delete method I always used... opening the table in access, selecting the record, right click on it. delete record. It works ok on other tables.
    I can insert into the table, no problem (see my other thread). And yes, if I change something in the record, no problem

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Sorry, no idea why manual delete would fail.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Are there other records related to that table? Referential Integrity
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    No, as far as I know. In fact, I want to delete a row in the "Ricevute" table, but I cannot do it because "ricevute" has a foreign key in "Primanota". So I try to delete the record in Primanota first, and get that error.
    The only reference I found in the web mentions the error happening in the insert command, if there are more or less fields than present in the row. But of course this is not the case. Other references mention a not clear incompatibility problem between what? mysql server and driver? But why only in this table?

  7. #7
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    I finally found the solution, thanks to a post in internet that seems to have a connection to the problem.
    What happens is that for some reason access cannot delete a record from a linked table if that record contains Null values. I had a null field there, I inserted there a random value (zero) and voilą, the delete record worked fine.
    I did not have this problem when I had the backend with MS sql server, so it must be a bug with mysql. The curious thing is that I got the hint from a post signalling this bug to mysql community on Oct. 22, 2024 related to the driver mysql odbc connector 8.4.
    Bug #116442 Unable to Delete Row Manually in Linked Table with Empty Values in Microsoft Acc
    https://bugs.mysql.com/bug.php?id=116442

    I am using 9.1, and apparently the bug is still present...

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Thanks for posting the reason, as it makes no sense whatsoever to me, as to the logic.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #9
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    What does not make sense to you? The error? The reason? If it is a bug, it does not make sense at all.
    What does not make sense to me is the fact that the mysql team states that the bug is "already solved in 9.1", whereas the error makes explicit reference to odbc 9.1.

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    The fact that you are not allowed to delete a record with a field having a Null value.?

    Edit: When a record is deleted, no concern should be given to the record contents.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    I fully agree with you. That is why I think this bug makes no sense at all, and the fact that it is still present makes even less sense. I hope someone notifies mysql team of the persistent bug, I would not know hoe to do it. At least, for now it is enough to be able to bypass the problem.

  12. #12
    davburk is offline Novice
    Windows 11 Office 365
    Join Date
    Mar 2025
    Posts
    1
    I am having this exact same issue with version 9.2 of mySQL ODBC connector . . . still not fixed.

  13. #13
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    Quote Originally Posted by davburk View Post
    I am having this exact same issue with version 9.2 of mySQL ODBC connector . . . still not fixed.
    Thank you for the post, at least I know I am not the only one tom face this problem. My question still remains: I don't know how to report this to mysql designers. Maybe the moderators here are more familiar with the procedure and know how to proceed?

  14. #14
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    When I don't know the answer to a question I often ask the Google god. Usually he answers.

    https://dev.mysql.com/doc/refman/8.4...g-reports.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    Oldvan is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2025
    Posts
    1

    Lightbulb I found a solution to this issue that worked for me.

    Quote Originally Posted by davburk View Post
    I am having this exact same issue with version 9.2 of mySQL ODBC connector . . . still not fixed.
    For me, adding a TIMESTAMP column to the table allows me to delete records without that dreaded error.

    In MySQL Workbench, I ran this:

    Code:
    ALTER TABLE tblYackitySchmackity ADD COLUMN ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP FIRST;

    Advice from here caused me to add this change:
    https://dev.mysql.com/doc/connector-...bc-errors.html
    Include a TIMESTAMP in all tables that you want to be able to update.
    I hope this helps someone here!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-19-2022, 03:43 PM
  2. Replies: 5
    Last Post: 03-11-2019, 02:35 PM
  3. Replies: 11
    Last Post: 12-14-2010, 01:25 PM
  4. Error when deleting a record
    By access in forum Forms
    Replies: 5
    Last Post: 06-15-2009, 12:33 PM
  5. Deleting Record Contents, not complete record...
    By Charles Waters in forum Access
    Replies: 2
    Last Post: 06-24-2008, 12:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums