[Solved] Error in macro to extract/reconnect embedded HSQLDB

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
fcsw
Posts: 12
Joined: Sun Aug 31, 2025 8:49 am
Location: Mars

[Solved] Error in macro to extract/reconnect embedded HSQLDB

Post by fcsw »

 Edit: Split from [Python] Macro to extract and reconnect embedded HSQLDB because the Code Snippets forum is only for sharing working examples of macros. Do not ask about problems there.
-- MrProgrammer, forum moderator  

Windows 11 25H2, LO 25.8.3.2
I ran Main and received the following error:

Code: Select all

com.sun.star.uno.RuntimeException: Couldn't convert file url  to a system path for reason (21) (Error during invoking function Main in module file:///C:/Users/rjhjr/AppData/Roaming/LibreOffice/4/user/Scripts/python/pyDBA/ExtractHSQL.py (<class 'uno.com.sun.star.uno.RuntimeException'>: Couldn't convert file url  to a system path for reason (21)
  File "C:\Program Files\LibreOffice\program\pythonscript.py", line 941, in invoke
    ret = self.func(*args)
          ^^^^^^^^^^^^^^^^
  File "C:\Users\rjhjr\AppData\Roaming\LibreOffice\4\user\Scripts\python\pyDBA\ExtractHSQL.py", line 151, in Main
    dba = DBA()
          ^^^^^
  File "C:\Users\rjhjr\AppData\Roaming\LibreOffice\4\user\Scripts\python\pyDBA\ExtractHSQL.py", line 64, in __init__
    self.fpath = uno.fileUrlToSystemPath(url.Protocol + url.Path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\LibreOffice\program\uno.py", line 133, in fileUrlToSystemPath
    return pyuno.fileUrlToSystemPath(url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
))
Last edited by floris v on Wed Dec 17, 2025 11:53 pm, edited 2 times in total.
Reason: Added Solved icon, floris v
NASA Mars Rover Hacking Project: Martians supplying Earth with bogus scientific data since 1997.
User avatar
Jurassic Pork
Posts: 32
Joined: Wed Oct 25, 2017 7:55 am
Location: France

Re: Error in macro to extract/reconnect embedded HSQLDB

Post by Jurassic Pork »

Hello,
is your odb file is in a path with special characters or has special characters. I have no problem to use the macro in my Champignons.odb (Mushrooms) file :
pyDBAdebug.gif
pyDBAdebug.gif (125.13 KiB) Viewed 8326 times
urlDebug.png
urlDebug.png (19.15 KiB) Viewed 8326 times
Friendly, J.P
OpenOffice 4.1.14 , LibreOffice 7.6.2.1 on Windows 11/ LibreOffice 7.3.7 on Lubuntu 22.04
fcsw
Posts: 12
Joined: Sun Aug 31, 2025 8:49 am
Location: Mars

Re: Error in macro to extract/reconnect embedded HSQLDB

Post by fcsw »

This has been resolved.

As for this thread, I didn't create it and I had no idea it existed.
NASA Mars Rover Hacking Project: Martians supplying Earth with bogus scientific data since 1997.
Post Reply