Using Microsoft Access Database Engine in LibreOffice Basic macros (Not for Windows haters)

WARNING for Windows only

For some time ago I opened a thread which related to using Microsoft Access Database Engine in LibreOffice Basic macros. More specifically, how to create mdb/accdb Database,Table and Fields and also inserting binary data to an OleObject field. For some reason the moderator team “liked” it so much they decided to hide the thread and finally removed it completely.
Well, one of the interesting detail of the conversation was one related to a pure java UCanAccess jdbc driver (as it was advertised) which turned out to be based mainly on empty MS Access database files stored into one UCanAccess .jar packages. But what then, it’s not any big deal :wink:
When I got my project working at first time I couldn’t fill OleObject field with binary data when tried to use ADODB object. I only succeeded when I used DaoDb object. The Dao version has been removed as well as the whole thread, but I still couldn’t resist posting this ADODB version to celebrate the success.

The project (Writer) package:
ADODB.odt (19.4 KB)

Here you can download a .zip package containing a file (help.rtf) to use for testing. Or if you like you can make your own e.g. using Writer and then save your file in .rtf format with name help.rtf
To get this working you need to build a simple ComVisible .NET .dll library which can be written e.g. with notepad. You can find instruction how to do this by clicking this link.
You don’t have to install anything on your system which is not included in Windows (10/11) installation, except Microsoft Access Data Base Engine.

Here’s the DaoDb version.
DaoDb.odt (19.9 KB)
If you like to test you can use the same test file as with ADODB version (help.rtf).

1 Like