Writer - insert database inside document to use in a macro

Hello, I have a macro on a document that changes some fields of it and export the document with each change as pdf.
The data used by the macro is stored inside a table in a page of the document which is excluded from the pdf.

I want to find a better way to store this list of data, specifically have property keys, values and types to set and get from the table. I have to store a Name and Surname for each field.

It is possible to embed a database inside the document? And how do I access it from a visual basic macro?

I’d work the other way round: Values in a database, then create an report (writer document) wich can be sent immediatly as pdf.
.
But also mail-merge may be sufficient. You are not forced to send to more than one person at a time…
.
PS: Visual Basic is not availabe here. Use MS-Office for this. Macros can be done with (Star-)-Basic and the main difference is UNO as library. Exception may be the use of Access2Base, but I never tried.

Well, I can’t use MS-Office because I have only LibreOffice instead.
It is possible to embed a excel sheet inside an odt document? and then access his cells from the macro?
The only way I see to include a sheet in a document is to add a graph, wich still need a new page to be included.

Welcome @anon96455709 !
Most likely you are surprised that your question has not been fully answered for so long. The fact is that in your question a lot of different terms are mixed - “database”, “odt file”, “Visual Basic macro” - and this shows that your level of acquaintance with this office suite is the most initial. Therefore, in order to give a solution to your problem, the respondent will have to tell in detail about the basics, about the individual components of this office suite (“database”, “Writer text documents”, “macro programming” and much more). When realize how much have to write, it just gets boring. Because all this has long been described in detailed illustrated documents, in many videos on YouTube, in various topics here on this resource. And to answer you with a rude RTFM - today it is simply indecent.
I understand your condition. You have a simple task - to take a text document template, insert data from individual rows of a table into some places and get separate files for printing or sending by e-mail. In addition, you have installed LibreOffice, which is written everywhere that it is an excellent free office suite that will do office work for the user. And it’s almost true - the job will be done. But it will not be done by LibreOffice itself, but by you with the help of LibreOffice.
To make things easier for both you and us, I suggest doing the following. You will view topics that can be found on this resource using Search. You will see how and what questions users ask in order to quickly get a comprehensive answer. Then you will break your task into separate steps and you will ask questions for each individual step - each question in a separate new topic. Perhaps this way the decision will be obtained much faster.
By the way, the answer that @jimk posted on StackOverflow to your question was quite detailed - you just lacked the skills to use this office suite a little.

Thank you @JohnSUN , the solution I got from stack overflow works. I’ve asked on stack overflow first because I didn’t know the existence of this forum, once I’ve subscribed here I’ve asked the same question.