OpenOffice connect to postgresql database

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
morak
Posts: 1
Joined: Thu Mar 30, 2023 10:59 pm

OpenOffice connect to postgresql database

Post by morak »

Hello,
Topic : how to connect do postgresql database with VBA ( Basic ) macros ?
Is it possible and easy for beginers ?
I can do it in the MS Excel + MSSQL environment, but in the case (OpenOffice) it is completely different, :?
maybe someone has an example of a file that I could use for learning , or there are some materials that will help me in this topic ?
First: I have to start by installing the drivers, right ?
https://www.openoffice.org/dba/drivers/ ... index.html

Thanks & br ,
Morak
OpenOffice 4 on Windows 10
Mountaineer
Posts: 314
Joined: Sun Sep 06, 2020 8:27 am

Re: OpenOffice connect to postgresql database

Post by Mountaineer »

morak wrote: Thu Mar 30, 2023 11:12 pm ... , or there are some materials that will help me in this topic ?
...
Have not looked at the english docs for OpenOffice for a while, but as there is not to much development on base you can use the guides to LibreOffice. On their website at Menu Help-> documentation. (The german version contains Details on MariaDB/ postgres/ Sqlite etc.)

At first to need to know, where the database is, like localhost or remote, then read about available connectors (odbc, jdbc, direct connector available). For local installation you may even have the odbc-drivers in place, with the database. Then you try to connect.

All this without any BASIC. When you have your connection register ist (give a name) to the connection. From now Base will hide from you the differences of the databases. You can (mostly) use every example from handbooks for HSLDB

Try the macros section of the named guide to use this with Basic. LibreOffice also has Access2Base to help.
More code also found at the site of the author of the german edition:
https://www.familiegrosskopf.de/robert/ ... alt=office
OpenOffice 3.1 on Windows Vista
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OpenOffice connect to postgresql database

Post by Villeroy »

With LibreOffice Base:
File>New>Database...
[X] Connect to existing database
Type: PostgreSQL
Specify the connection string according to the documentation of your database.
[X] Register the database
Save the database.
Now you have a Base document showing the tables of your PostgreSQL database.
Add queries, forms and reports.
Create mail merge document in Writer.
Feed calculation models in Calc.

https://wiki.documentfoundation.org/Doc ... e_Handbook
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply