Description: In LO 7.0 on MacOs and Linux using an embedded firebird database it ist not possible to access any method of the recordset-fields-object in LO Basic. The following code produces an error in LO 7.0 but works with LO 6.4.6: Dim objRec As Object Dim objCon As Object Dim objField As Object If GlobalScope.BasicLibraries.hasByName("Access2Base") Then GlobalScope.BasicLibraries.loadLibrary("Access2Base") End If Call Application.OpenConnection(ThisDatabaseDocument) Set objCon = Application.CurrentDb() Set objRec = objCon.OpenRecordset("SELECT * FROM KONTAKTE") Dim intCount As Long intCount = 0 While Not objRec.EOF intCount = intCount + 1 ' The following Line produces the error-message given below: ' Dim objRec As Object Dim objCon As Object Dim objField As Object If GlobalScope.BasicLibraries.hasByName("Access2Base") Then GlobalScope.BasicLibraries.loadLibrary("Access2Base") End If Call Application.OpenConnection(ThisDatabaseDocument) Set objCon = Application.CurrentDb() Set objRec = objCon.OpenRecordset("SELECT * FROM KONTAKTE") Dim intCount As Long intCount = 0 While Not objRec.EOF intCount = intCount + 1 ' Die folgende Zeile verursacht den Fehler: ' Error #13 (Datentypen unverträglich) aufgetreten in Zeile 407 in Field.getValue msgBox objRec.Fields("NAME1").Value objRec.MoveNext() Wend objRec.MoveFirst() msgBox objRec.Fields("NAME1").Value objRec.MoveNext() Wend objRec.MoveFirst() Steps to Reproduce: 1.Just use any firebird database and execute the given code 2. 3. Actual Results: Error-Message: "Error #13 (Datentypen unverträglich) aufgetreten in Zeile 407 in Field.getValue" produced - the same is for any method of the fields-Object Expected Results: The basic code-crashes Reproducible: Always User Profile Reset: No Additional Info: printed out the field values
I may be wrong but Access2Base concerns MS Access database, it's not a lib to access any database, in your case a Firebird database. Jean-Pierre: any thoughts here?
Yes, in this case you are wrong. Access2Base adds a Layer around Uno-Api to access any Database in an Ms-Access like manner. I use it for one reason, In A2B you can use MoveNext and MoveLast Methods, in a way with Firebird-Databses which present a bug in Uno...
Would it be possible you provide a minimum embedded Firebird database file with the macro so it could be quickly reproduced? Of course, don't forget to sanitize it (see https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission)
Created attachment 164632 [details] Database-File with Access2Base Code To start the app run Sub Main in Module A2B of the attacheched odd-File The code works in LO 6.4.6 but produces an Error-Message in LO 7.0
Jean-Pierre Ledure committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fcb2b4695fdc7f5c9915a176762cfcbafe96e945 Access2Base - tdf#136063 Workaround Basic missing argument handling It will be available in 7.1.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.
I implemented a patch as a workaround for a different behaviour of the Basic interpreter between 6.4 and 7.0. I don't know yet if it is a bug or a feature. Read my comment in the commit: When an argument is missing in a call to a Basic function the IsMissing() function applied on the argument should respond True. However sometimes(?) the argument contains instead "Error 448" making IsMissing responding False. This commit puts an explicit argument in the function call avoiding the different behaviour of the Basic interpreter in LO 7.0 vs. previous releases. Error 448 = "Named argument not found" This patch solves the issue at least in my Linux/LO 7.0 environment. Thanks for having reported the issue.
It could be somehow related to https://gerrit.libreoffice.org/c/core/+/90215, but I am not sure.
More likely to https://gerrit.libreoffice.org/c/core/+/87550
Jean-Pierre Ledure committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/57666b8ba70f27c7250ef32f4cb9e7660e258521 Access2Base - tdf#136063 Workaround Basic missing argument handling (2) It will be available in 7.1.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.
Thank you Jean-Pierre Ledure! However, I suppose it's incorrect to workaround bugs like this. We should simply fix tdf#136143 (that unfortunately only was filed lately; the solution is already being discussed in the gerrit change that had introduced the problem - see comment 8), and avoid constructs like in the committed patches, that will become burden to support...
Mike, I can only agree with you !! Fair enough but, in the meantime, the Access2Base library is broken for 7.0 users, while the identification of the root cause was not obvious. Hence the 136143 bug report. Additionally, the correction of bug#136143 is out of my competence ... If such a correction can be introduced soon for 7.0, I will revert my changes on master.
Hello again, just tested the code with LO 7.0.1 - the error still present, so do users have to wait until 7.1 some time in next year? Or will the fix be included in an earlier release. Thanks
The resolution of tdf#136143 solves the current issue. It will be available in LO 7.0.2, which, according to https://wiki.documentfoundation.org/ReleasePlan/7.0#7.0.2_release, is announced for the week of Oct 5, 2020. That patch makes the correction introduced in 7.1 unnecessary.
Hello again, I've just reread my comment. It was neither meant to sound unfriendly nor demanding. Apologies
No problem. Your question was relevant, anyway. *** This bug has been marked as a duplicate of bug 136143 ***