Access Libreoffice

admin 11/22/2021
7 Comments

LibreOffice is one such package. But that's easily remedied by installing the Dropbox desktop software, which gives you instant access to your account as though it was a folder on your PC. LibreOffice / ˈ l iː b r ə / is a free and open-source office productivity software suite, a project of The Document Foundation (TDF). It was forked in 2010 from OpenOffice.org, which was an open-sourced version of the earlier StarOffice.The LibreOffice suite consists of programs for word processing, creating and editing of spreadsheets, slideshows, diagrams and drawings, working with.

Access2Base is a LibreOffice Basic library of macros for (business or personal) application developers and advanced users. It is one of the libraries stored in 'LibreOffice macros and dialogs'. The functionalities provided by the implemented macros are all directly inspired by Microsoft Access.

Tags: BaseExtensions

Rating:

VBA for MSAccess emulator

Description

Access2Base is a standard feature of LibreOffice. The 1.9.0 version (= last available version of the extension) is pre-installed in LibreOffice 6.1.

Later LibreOffice releases (6.2 ... 7.0) embed Access2Base fresher releases (6.2.0 ... 7.0.0). The latter Access2Base versions are not available as extensions anymore and never will.

Download this software only if your LibreOffice version is <= 6.0.

This extension implements a LibO/AOO Basic library for Base applications.


The API is entirely inspired by VBA for MSAccess and its object model.

As such it is a tool helping people either to migrate their Access databases to Base OR to write code as if it was VBA OR to write their first macros.
It is much more intuitive and easy to learn than the standard UNO API. It is documented (online) in detail.
Version 1.9.0 was uploaded to this site on 11-Aug-2018.

The implemented macros include (among a huge list of functionalities):

  1. forms, dialogs and controls manipulations derived from the MSAccess object model
  2. an API for database access with the table, query, recordset and field objects
  3. actions with a syntax identical to their corresponding MSAccess macros/actions
  4. the DLookup, DSum, ... database functions
  5. the support of the shortcut notations like Forms!myForm!myControl
  6. a consistent errors and exceptions handler
  7. facilities for management of form and control events

The macros using the API may be stored both in Database documents ('.odb' files) and in standalone (Writer/Calc/...) forms.

It is even possible to access data from Calc cell formulas.

(Only to have a first idea ...) Compare Access2Base with MSAccess VBA
LibreOffice Base with Access2Base

REM Open a form ...

DoCmd.OpenForm('myForm')

REM Move a form to new left-top coordinates ...

Dim ofForm As Object
Set ofForm = Forms('myForm')
ofForm.Move(100, 200)

REM Get the value of a control ...

Dim ocControl As Object
ocControl = ofForm.Controls('myControl')
MsgBox ocControl.Value

REM Hide a control ...

ocControl.Visible = False

REM ... or alternatively ...

setValue('Forms!myForm!myControl.Visible', False) ' Shortcut notation' in VBA => Forms!myForm!myControl.Visible = False

Access Libreoffice

Additional documentation: http://www.access2base.com/access2base.html

Access Libreoffice

Homepage: http://www.access2base.com/access2base.html

Release List

Access Libreoffice
  • ReleaseDescriptionCompatibilityOperating SystemsLicenseRelease notes
  • 1.9.0Base forms may contain more than 1 data source (NB: MSAccess does not have that feature).
    A translation in german is provided (thanks to Gisbert Friege).
    5.0Linux, Windows, macOSLGPLDownload
  • 1.8.0Document, dialog, form, subform and control events can be dynamically got and updated with the new On database, On dialog, On form and On control events properties.
    The new module object class and its properties and methods makes it easy to navigate thro
    4.0Linux, Windows, macOSLGPLDownload
  • 1.6.0The CopyObject action may copy tables (structure and data) from one database to another. As an experimental feature involved tables may even reside in different database systems.
    The database class has received new properties: Name, Connect and Version.
    4.0Linux, Windows, macOSMPLDownload
  • 1.5.0More complete management of (long) binary fields in databases with the addition of the GetChunk and AppendChunk methods to the field object.<br />
    Addition of the Picture property for ImageControl controls.
    4.1MPLDownload
  • 1.4.0The OutputTo action has been significantly enhanced. Output in one single Basic statement the content of a table or of a SELECT query into
    - an html file. The data table can be embedded in a template file wontaining styling options
    - a Calc spreadsheet
    4.1MPLDownload
  • 1.3.0New CommandBars collection of CommandBar objects:
    Easily show/hide menu bar, status bar, toolbars and toolbar elements.
    4.0MPLDownload
  • 1.2.0All the methods which can be used without a database connection (error handling, dialogs manipulations, status bar and window handling, commands launch, ...) are usable as such even from non-Base applications.
    To pass values from one open document to ano
    4.1MPLDownload
  • 1.1.0The 1.1.0 version allows dynamic data access from any Basic macro, including, just as an example, from a user-defined function invoked in a Calc cell formula. 3.6MPLThe Access2Base library can be run to access a database defined in any form defined in any AOO/LibO document. Now the CurrentDb method may be associated with a form object, not only with the root class.The OpenDatabase method allows any AOO/LibO document or any Basic macro to get access to tables stored in any database.The CopyObject (new) action copies query definitions and/or table definitions and data.Creation of table and fields without SQL with the CreateTableDef, CreateField and Add methods.The new GetRows method loads a given number of records from a recordset in a Basic array.RunSQL, OpenSQL, database functions have been extended to be run from a database object, not only as a command.New GetHiddenAttribute and SetHiddenAttribute actions hide or show any AOO/LibO or Base object. SelectObject scope has been extended accordingly.The Description property of a TableDef is writable.Addition of the SelStart, SelLength and SelText properties for text controls.Download
  • 1.0.0Inclusion of Access2Base code into the LibreOffice 4.2 build.
    Code stabilisation, robustness improvements (naming collisions risks, error handler, ...)
    Toggle sidebar in RunCommand
    Alignment of code with LibreOffice 4.2 new internal format for Time fie
    3.3MPLDownload
  • 0.9.5Framework for database access:
    TableDefs, QueryDefs, Recordsets and Fields collections.
    TableDef, QueryDef, Recordset and Field objects.
    Addition of the CurrentRecord and Recordset properties for forms and subforms.
    Introspection improved with the Ite
    3.6LGPLDownload
  • 0.9.1Bug fixing.
    Performance improvement when processing very large (1000+ items) listboxes.
    Workaround implemented to survive the LibreOffice 4.0 bug described in BugZilla (https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752)
    Finalization of the App
    3.6LGPLDownload
  • 0.9.0Complete internal redesign of code to allow more object-oriented syntaxes for property settings and method invocations.
    E.g.
    form.height = 100
    form.move(100,200)
    Old syntax still supported.
    Consolidation of the object model with the Parent, S
    3.3LGPLDownload
  • 0.8.9Localization:
    - of the 2 dialogs forms
    - of all strings (mainly error messages) used in the API
    A french translation is provided.
    For other languages, contributions are welcome.
    3.3LGPLDownload
  • 0.8.6Maintenance release3.3LGPLDownload
  • 0.8.5Introduction of new commands:
    OutputTo for storing a form document as a PDF, DOC, ... file.
    SendObject to send a form after transformation to PDF, DOC, ... by mail.
    RunApp to start an external application.
    3.3LGPLDownload
  • 0.8.2API implementation identical to 0.8.1.
    'Check for Updates ...' functionality now detects Access2Base new versions.
    3.3LGPLDownload
  • 0.8.1Bug fixing in the setValue method.3.3LGPL

    Bug fixing in the setValue method.

    Download
  • 0.8.0Full support of standalone (Writer) forms.3.3LGPL

    Full support of standalone (Writer) forms.

    Other minor changes:

    RadioButtons order is now determined by their X-Y coordinates on the screen.
    Bug fixing in checkboxes controls when linked to a database field.
    Support of 'Currency' datatype in arguments to the API. Useful for controls of currency type. Converted to Double in internal processing.

    Download
  • 0.7.5Support of Listboxes with a separate column for bound fields.
    Introduction of the Bookmark property of Form pseudo-objects.
    New actions: ShowAllRecords and GoToControl.
    New methods for managing Listboxes content (with the ValueList rowsource type): Add
    3.3LGPLDownload
  • 0.7.1Correction of URL of online help. Clickable from Help menu in the Basic IDE.3.3LGPLDownload
  • 0.7.0Bugs fixing in the SelectObject action (abort when help file open).
    Extension of the scope of the SelectObject action.
    Introduction of the RunCommand action. Documentation updated.
    3.3LGPLDownload
  • 0.6.0New actions: Maximize, Minimize, etc.3.3LGPLDownload
  • 0.5.1Minor changes vs. version 0.5.03.3LGPLDownload
  • 0.5.0First public release3.3LGPLDownload
  • → Open Issues
Deutsch • ‎English • ‎Nederlands • ‎Türkçe • ‎dansk • ‎español • ‎français • ‎italiano • ‎português do Brasil • ‎čeština • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어


The user profile is the folder storing all user related data like extensions, custom dictionaries, templates, etc. This folder is not removed when uninstalling or updating LibreOffice, so your customizations are kept.


Backup first

Before modifying your user profile, create a backup so you can return to the old user profile.

LibreOffice developers might ask for a copy of your user profile for debugging and bugfixing so please do not delete the backup file instantly.

Note: if you heavily customize LibreOffice, then making a periodic backup of the profile may help in case of problem. Even if shortcuts, user interface, etc. can be exported through single configuration files, restoring the whole profile will spare you the import of each single configuration file and the reinstallation of the extensions you could have added.


Resolving corruption

Many problems in LibreOffice can be caused by corruption in the user profile.

When noticing strange behavior in LibreOffice the first thing to do is to reset the user profile. To do so, 2 methods are available.

Help wizard (LibreOffice 5.3 and newer)

  • Start LibreOffice and select HelpRestart in Safe Mode
    • In the Enter Safe Mode dialog select Restart
    • LibreOffice will restart and display the Safe Mode dialog
  • If your problem is that LibreOffice does not start at all, launch it from the command line with libreoffice --safe-mode or use the start menu entry LibreOffice (Safe Mode) on Windows
  • Select Continue in Safe Mode
  • Test and see if the problem is gone.
    • If the problem persists, you can exit the safe mode because the user profile was not the cause of the problem.
    • If the problem is solved, something is wrong with your configuration. Start LibreOffice in safe mode again to see the safe mode dialog. You can now try to disable Hardware acceleration or to restore/reset your user profile.

Manual procedure (all versions)

If you are using an old version of LibreOffice, or if the Help wizard procedure detailed above seems too complicated:

Access Libreoffice
  • Close LibreOffice including 'QuickStart' in system tray.
  • Find your user profile per information below, according to your operating system.
  • Rename the folder /user to (for example) /user-old.
  • Launch LibreOffice, a new /user folder will be created with factory settings.
  • Test and see if the problem is gone.
    • If the problem persists, you can restore the previous profile because it was not the cause of the problem. To do so, delete the newly created /user folder and give the renamed old one its former name /user back.
    • If the problem is solved, it means that one or several configuration files were damaged. But it doesn't mean that the whole profile is dead. If you have heavily customized LibreOffice, you can still try to retrieve some parts of your configuration: as you have kept a backup (/user-old), copy the subfolders (one at a time), and restart LibreOffice to see if the issue comes back or not. You can therefore spot from where the issue comes. Look at the content of the profile (below), some are less prone to corruption than others.

Libreoffice Access Database


Expert information

Find the location of your user profile: ToolsOptionsLibreOfficePaths.

Default locations

The number used in the path below refers to the last major version of LibreOffice that created that kind of profile. The format has changed from LibreOffice 3 to LibreOffice 4. You might wonder why the number has not increased with LibreOffice 5; this is because the format has not changed since LibreOffice 4. Changing that number will lose the user's personal configuration. If LibreOffice changes or removes this number in the future, then your own scripts must be modified.

Windows

  • %APPDATA%libreoffice4user (LibreOffice 4 to 7)
  • %APPDATA%libreoffice3user (LibreOffice 3)

Note: on a normal Windows install, %APPDATA% resolves to C:Users<user name>AppDataRoaming, at least on English versions of Windows Vista and later (part of the path may be localized on non-English versions).

Thus, you can copy and paste %APPDATA%libreoffice4 in the File Explorer Address Bar and press ↵ Enter to access it directly. Or press ⊞ Win+r and write %appdata% and hit ↵ Enter.

GNU/Linux

  • /home/<user name>/.config/libreoffice/4/user (LibreOffice 4 to 7)
  • /home/<user name>/.config/libreoffice/3/user (LibreOffice 3 since 3.5.0)
  • /home/<user name>/.libreoffice/3/user (prior to LibreOffice 3.5.0)

Note: This is for the LibreOffice packages distributed by The Document Foundation. Versions provided by your Linux distribution may use a slightly different path.

Remember that the .config folder is a hidden folder in your /home.

macOS

  • ~/Library/Application Support/LibreOffice/4/user (LibreOffice 4 to 7)
  • ~/Library/Application Support/libreoffice/3/user (LibreOffice 3)

Libreoffice Access Equivalent

For LibreOffice Vanilla provided by Collabora at the App Store check

  • ~/Library/Containers/com.collabora.libreoffice-free (LibreOffice 5.4)

LibreOffice Portable

Access Libreoffice
  • LibreOfficePortableDatasettingsuser


User profile content

Inside the user profile there are several highly specialized folders:

  • autocorr: the substitution table you can configure on ToolsAutoCorrectAutoCorrect Options...
  • autotext: the 'AutoText' (ToolsAutoText) you created.
  • backup: the file backups you get when enabling the option Always create backup copy is enabled under ToolsOptionsLoad/SaveGeneral.
  • basic: all your macros.
  • config: some configuration files, especially toolbars for each module. Custom color palettes are also stored here.
  • database: the databases you registered.
  • extensions: registered extensions
  • gallery: your personal gallery (ViewGallery).
  • psprint: may contain a 'driver' subfolder (which may be empty), a 'fontmetric' subfolder (which may be empty), and a 'pspfontcache' file (in which printer fonts are cached). The 'psprint' folder may be missing entirely. If it is present, it may be deleted without ill effect. If it is deleted, it will not necessarily be recreated.
  • registry: contents the most part of the configuration files.
  • Scripts: contains the optional Folders for user-defined scripts: beanshell, java, javascript and python. (for example the scripts you find over: ToolsMacrosOrganize MacrosPythonMy Macros)
  • store: may either be empty or contain a file named '.templdir.cache' (in which templates are cached). The 'store' folder may be missing entirely but is usually present. If present, it may be deleted without ill effect. If it is deleted, it is usually but not always recreated.
  • temp: may contain an 'embeddedfonts' subfolder that in turn contains a 'fromdocs' subfolder and a 'fromsystem' subfolder. The 'fromdocs' and 'fromsystem' subfolders may either be empty or contain temporary files. The 'temp' folder may also contain a file named 'document_io_logring.txt', which is a log of executed instructions. The 'temp' folder may be missing entirely. If it is present, it may be deleted without ill effect. If it is deleted, is is not always recreated.
  • template: here you can find your custom templates (FileTemplatesOrganizeMy templates)
  • uno_packages: the extensions installed by the user.
  • wordbook: the custom dictionaries. (see also this tutorial)

Some extensions (like OOoLatex) could add other folders.

NOTE: other than the user profile, LibreOffice considers the configuration for all users you can find in the subfolders inside the main installation folder (for example, /opt/libreoffice/share on Linux for the 'official' LibreOffice build, or Program fileslibreofficeshare on Windows)


Reusing user profiles

A single user profile must only ever be accessed by a single LibreOffice process. Internally, if a single user starts multiple LibreOffice processes that would all access the same user profile, only the first process does any actual work, like opening documents for editing, and the excess processes pass on their command line arguments to the first one for processing. Especially, one must not reuse a single user profile across multiple accounts on one computer, or across computers.

Also, different versions of LibreOffice can store different sorts of data in their respective user profiles. If a new version of LibreOffice does not yet find a user profile at the default location for that version, it looks for existing user profiles from old LibreOffice or OpenOffice.org versions at well-known locations and migrates any data it can continue to use to the new location. Strange effects might occur, if you explicitly request a LibreOffice version to reuse a user profile from another version.

However, most of the content of the user profile can be safely copied from a machine to another to duplicate the same configuration. Especially custom dictionaries, color palettes, shortcuts, toolbars, extensions...

Retrieved from 'https://wiki.documentfoundation.org/index.php?title=UserProfile&oldid=360273'