Page 1 of 1

Problem with "Free HSQLDB 0.3.6"

PostPosted: Wed Jul 05, 2017 11:05 pm
by dreamquartz
Hi Villeroy,

I have a problem with the Macro: FreeForms.
When I try to extract forms in either an internal or a split database, the following is shown:
Screenshot from 2017-07-05 13-46-41.png
and some more of the same type and the macro finishes with
Screenshot from 2017-07-05 13-48-28.png
Screenshot from 2017-07-05 13-48-28.png (10.21 KiB) Viewed 3002 times


The question for the file folder is asked, and made possible, but the resulting file folder is empty.
I tried to rename the Forms, but to no avail.

Dream

Re: problem with "Free HSQLDB 0.3.6"

PostPosted: Wed Jul 05, 2017 11:46 pm
by Villeroy
LibreOffice changed the API at this point. It is not an easy fix because I have difficulties understanding the changed services.
And yes, my error handling is wrong when it cancels the program but still shows the final success message.

 Edit: I think I got it. I'm too tired right now. Good night. 

Re: problem with "Free HSQLDB 0.3.6"

PostPosted: Thu Jul 06, 2017 6:58 pm
by Villeroy
FreeHSQLDB-0.3.7.oxt is mostly compatible with LO. For some reason that can not be revealed by simple debugging, the FreeForms macro fails to connect extracted forms with unregistered databases. OpenOffice still does the trick and the forms extracted from unregistered database by OpenOffice/FreeForms actually work with LibreOffice.

LibreOffice has no problem with the assignment
Code: Select all   Expand viewCollapse view
f.DataSourceName = gDataSourceName

where variable f is a logical (sub-)form but for some reason the assignment does not stick if it is a the URL of the database document. A registered data source name does stick.

For those who are interested, I add my test database here. It contains the same form copied into some folders and subfolders. The form has subforms and subsubforms referencing the same table by means of direct table access, a query, parsed SQL and native SQL. A text field shows the extracted document's path and everything is OK if all the text boxes show the same text as their associated labels.

Re: problem with "Free HSQLDB 0.3.6"

PostPosted: Fri Jul 07, 2017 8:30 am
by dreamquartz
Villeroy wrote:FreeHSQLDB-0.3.7.oxt is mostly compatible with LO. For some reason that can not be revealed by simple debugging, the FreeForms macro fails to connect extracted forms with unregistered databases. OpenOffice still does the trick and the forms extracted from unregistered database by OpenOffice/FreeForms actually work with LibreOffice.

LibreOffice has no problem with the assignment
Code: Select all   Expand viewCollapse view
f.DataSourceName = gDataSourceName

where variable f is a logical (sub-)form but for some reason the assignment does not stick if it is a the URL of the database document. A registered data source name does stick.

For those who are interested, I add my test database here. It contains the same form copied into some folders and subfolders. The form has subforms and subsubforms referencing the same table by means of direct table access, a query, parsed SQL and native SQL. A text field shows the extracted document's path and everything is OK if all the text boxes show the same text as their associated labels.


Sorry, but it does not work in OO 4.1.2, LO 5.4.3.2, and LO 5.2.7.2, with FreeForms.test.odb, or any of my databases.

Dream

Re: Problem with "Free HSQLDB 0.3.6"

PostPosted: Fri Jul 07, 2017 4:35 pm
by Villeroy
"Does not work" does not provide any useful information. What did you do? What did actually happen?

Nevertheless, I found the problem on a Windows system where I do not develop anything. It is GlobalScope.BasicLibraries.loadLibraries("MriLib"). You can safely remove that line. In the code snippets forum I replaced yesterday's oxt with a new one (same version number).

On that Windows system with LO 5.2 I don't see the problem with unregistered sources. So that may be a bug in LO 5.3.
Edit: https://bugs.documentfoundation.org/sho ... ?id=109004

Re: Problem with "Free HSQLDB 0.3.6"

PostPosted: Sun Jul 09, 2017 8:38 am
by dreamquartz
Villeroy wrote:"Does not work" does not provide any useful information. What did you do? What did actually happen?

Nevertheless, I found the problem on a Windows system where I do not develop anything. It is GlobalScope.BasicLibraries.loadLibraries("MriLib"). You can safely remove that line. In the code snippets forum I replaced yesterday's oxt with a new one (same version number).

On that Windows system with LO 5.2 I don't see the problem with unregistered sources. So that may be a bug in LO 5.3.
Edit: https://bugs.documentfoundation.org/sho ... ?id=109004

My Bad,
Indeed it also is the case for the GlobalScope in Ubuntu 16.04.
BTW: The updated version does not exist anymore (:
However, editing the Macro, and removing the line, does do the trick under Ubuntu.
Did not check Windows.

Dream

Re: Problem with "Free HSQLDB 0.3.6"

PostPosted: Sun Jul 09, 2017 10:24 am
by Villeroy
In order to resolve the original problem which originated from internal changes in LibreOffice, I used a helpful tool called "MRI". I loaded the MRI library, analysed the changes in LO and adjusted my code to be compatible with recent versions of both LibreOffice and OpenOffice.

Therefore the line which caused the second problem raising the error message when trying to load MRI where no MRI is availlable. On my system I did not see that message until I tried the macro on a system at my work place where no MRI is installed. If I had had MRI installed on that system I still would not know what the problem on your system was.

The third problem about non-registered databases not being usable with external forms affects LibreOffice 5.3 and it is described in the linked bug report. There is another comment to add to that report: It affects non-registered databases only if those forms had a former life in a database document.

Re: Problem with "Free HSQLDB 0.3.6"

PostPosted: Mon Jul 10, 2017 8:51 am
by dreamquartz
Villeroy wrote:In order to resolve the original problem which originated from internal changes in LibreOffice, I used a helpful tool called "MRI". I loaded the MRI library, analysed the changes in LO and adjusted my code to be compatible with recent versions of both LibreOffice and OpenOffice.

Therefore the line which caused the second problem raising the error message when trying to load MRI where no MRI is availlable. On my system I did not see that message until I tried the macro on a system at my work place where no MRI is installed. If I had had MRI installed on that system I still would not know what the problem on your system was.

The third problem about non-registered databases not being usable with external forms affects LibreOffice 5.3 and it is described in the linked bug report. There is another comment to add to that report: It affects non-registered databases only if those forms had a former life in a database document.

K,

The DB in question is registered, though. I was able to extract all forms under Ubuntu.

Dream

Re: Problem with "Free HSQLDB 0.3.6"

PostPosted: Mon Jul 10, 2017 9:53 am
by Villeroy
dreamquartz wrote:The DB in question is registered, though. I was able to extract all forms under Ubuntu.

Dream

Thank you for the feed back and for trying my lousy code.

Re: Problem with "Free HSQLDB 0.3.6"

PostPosted: Tue Jul 11, 2017 7:05 pm
by dreamquartz
Villeroy wrote:
dreamquartz wrote:The DB in question is registered, though. I was able to extract all forms under Ubuntu.

Dream

Thank you for the feed back and for trying my lousy code.

How dare you to talk like that.
You're one of the most appreciated contributors to the community.

I use your so called "lousy code" almost every single day as follows:
1. Laptop (Ubuntu 16.04 LTS), single user
2. Synchronize to USB stick
3. Synchronize USB stick to Desktop (Windows 7 PRO), single user
4. Synchronize to USB
5. Synchronize to Laptop
The reason for this is, that I am very mobile and the database carries a lot of confidential information, I do not want to access over the internet.
I modify the DB structure, update/manipulate data entries at home, my office, and at the "beach"/client's.

This "lousy code" saves my day.
Keep up the GOOD!!!!!!!!! work, and thank you.

Dream