Bug 148367 - EDITING MS Access through 64-bit ODBC doesn't work and returns an Invalid Bookmark error
Summary: EDITING MS Access through 64-bit ODBC doesn't work and returns an Invalid Boo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: high normal
Assignee: Mike Kaganski
URL: https://youtu.be/M_hqZegXcXM
Whiteboard: target:25.2.0 target:24.8.1
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-04 13:17 UTC by Claude von Roesgen
Modified: 2024-08-20 14:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Error message when editing an MS Access record using LO Base via ODBC (158.25 KB, image/png)
2022-04-04 13:18 UTC, Claude von Roesgen
Details
An empty Access database (260.00 KB, application/msaccess)
2024-07-28 07:13 UTC, Mike Kaganski
Details
The error window editing a field (11.60 KB, image/png)
2024-07-29 11:09 UTC, jcsanz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claude von Roesgen 2022-04-04 13:17:05 UTC
Description:
If you try to edit an MS Access table using LO Base and an ODBC connection you get an error message saying the the bookmark is invalid.

Steps to Reproduce:
Use LO Base to connect via ODBC to an MS Access .accdb file using the 
Microsoft Access Driver version 16.000.15028.20050 ACEODBC.DLL
Edit a record and then move off the record to commit the edit.

Please watch this YouTube video:
https://youtu.be/M_hqZegXcXM


Actual Results:
Error message blocking the edit of the record

Expected Results:
Record is edited


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Please watch this video to see how to reproduce the bug:
https://youtu.be/M_hqZegXcXM
Comment 1 Claude von Roesgen 2022-04-04 13:18:18 UTC
Created attachment 179306 [details]
Error message when editing an MS Access record using LO Base via ODBC
Comment 2 Robert Großkopf 2022-04-04 13:59:08 UTC
Have no Access and Windows here, but are you sure it is a bug of Base? I have searched for 'Access "not a valid bookmark"' and get many results. Some try to repair the database through ODBC-GUI, some says the file is corrupted …
Comment 3 Claude von Roesgen 2022-04-04 14:23:09 UTC
MS Access ODBC driver is a very solid drive and I suspect it is a bug in Base. This is not a corruption issue with the MS Access database. This bug I believe is related to the other bug I filed:
https://bugs.documentfoundation.org/show_bug.cgi?id=148343

You can replicate bug 148343 with Ubuntu. No need for Windows.
Comment 4 Timur 2022-04-07 13:23:41 UTC
I confirm with 64-bit LO 7.4+ in 64 Win 7 with 64-bit Access Database Engine 2016.
Should also be tested with 32-bit. 

Problem is that ODBC has this error and MS Access driver read-only bug 43187 so not usable at all.
Comment 5 Timur 2022-04-08 08:42:38 UTC
Problem didn't exist with 32-bit Access Database Engine and LO. 
I set High because now 64-bit is usually used and users may not even think of 32/64 issue. Also because this shouldn't be a large problem. And because direct access also doesn't work so Access database not usable but relatively frequent.
Comment 6 QA Administrators 2024-04-08 03:13:54 UTC Comment hidden (obsolete)
Comment 7 Claude von Roesgen 2024-04-10 01:16:22 UTC
This bug still exists in 24.2.2
Comment 8 Mike Kaganski 2024-07-28 07:13:52 UTC
Created attachment 195559 [details]
An empty Access database

How can this bug be tested? There is no accdb test file here. With my own generated data, I see no problem:

1. Using Windows ODBC 64-bit applet, add a new user DSN; choose Microsoft Access Driver (*.mdb; *.accdb); on the ODBC Microsoft Access Setup page, click [Create...] and choose where to save the new accdb file. I attach an empty such file.

2. In LibreOffice, create a new ODB connected through ODBC to this DSN.

3. In LibreOffice Base, use Tools->SQL, and run these SQL commands:

CREATE TABLE noPrimaryKey (
 [str] VARCHAR
);

CREATE TABLE hasPrimaryKey (
 [id] INT NOT NULL PRIMARY KEY,
 [str] VARCHAR
);

Note that they should be executed separately. Also note that [x] Show output of SELECT statements should be checked, otherwise you will see an error instead of success (but the table will be created).

4. Refresh tables (or reopen database), and try to edit tables.

Both tables are editable for me using Version: 24.8.0.1 (X86_64) / LibreOffice Community
Build ID: 6fd6cae02baed1e82d14ed2da1f2458092354dab
CPU threads: 24; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: en-US (ru_RU); UI: en-US
Calc: CL threaded
Comment 9 jcsanz 2024-07-29 11:09:46 UTC
Created attachment 195578 [details]
The error window editing a field

(In reply to Mike Kaganski from comment #8)
> Created attachment 195559 [details]
> An empty Access database

> Both tables are editable for me using Version: 24.8.0.1 (X86_64) /
> LibreOffice Community
> Build ID: 6fd6cae02baed1e82d14ed2da1f2458092354dab
> CPU threads: 24; OS: Windows 11 X86_64 (10.0 build 22631); UI render:
> Skia/Vulkan; VCL: win
> Locale: en-US (ru_RU); UI: en-US
> Calc: CL threaded

After I have followed al your steps to test the bug, and using your sample database (also a new created one), I follow the next adicional steps:
1 Add some registers to the table hasPrimaryKey, for example:
  id     str
  ---  --------
   1      A
   2      B
no problems till now

2 In table data view, I try to modify the first record, for example, set the str field to "Aa", the error message of this image appears, and it is not possible to change the data.

I have tested on table hasPrimaryKey, because in Base usually a table without a primary key is not editable, although in this case it is possible to add data to both tables, with and without primary key (and in both cases it is not possible to modify existing records).

------
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 233af54afb6e493c3538efe7c93d0f53f1b4c3ab
CPU threads: 1; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: threaded
Comment 10 Mike Kaganski 2024-07-30 09:10:06 UTC
This is NOTOURBUG.

I filed MS issue at https://developercommunity.visualstudio.com/t/MS-Access-ODBC-64-bit-fails-SQLBulkOpera/10712541 ; it will likely be moved to an appropriate component (or closed), because I filed it as a Visual Studio bug, while it is indeed an Access bug, and I have no access to their Access bug tracker (or I don't know how to access it). Anyway, it shows a standalone C++ code that fails using 64-bit Access drivers, but succeeds using 32-bit drivers.

Answering to "this shouldn't be a large problem" from comment 5, I can only say that guessing like that usually creates smiles at the hindsight ;-) We simply can't fix this ourselves.
Comment 11 Mike Kaganski 2024-07-31 06:56:41 UTC
A workaround is here: https://gerrit.libreoffice.org/c/core/+/171270
Comment 12 Commit Notification 2024-08-01 05:27:57 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e47197b4ef1753af4d005a6918c26e6a3d589c67

tdf#148367: avoid using SQLBulkOperations with SQL_UPDATE_BY_BOOKMARK

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2024-08-20 14:41:36 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/2b8ccebced9ebfcf2f86a13330e9f62c984f38f5

tdf#148367: avoid using SQLBulkOperations with SQL_UPDATE_BY_BOOKMARK

It will be available in 24.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.