I need marco function to connect a remote DB

i have the following environment

  1. win 10 sys 2) libreoffice 6.4 3) MariaDB 64bit ODBC 3.1 driver
    I want to complete the following function

Global oCon as object

sURL = “//server:3306” server name or IP and port

Function connect(sUser as string, sPass as string, sIRL as string) as iResult

Hello,

With ODBC, the URL information is established in the OS. For MariaDB see this post → Creating a Data Source with MariaDB Connector/ODBC

Once you have established this, the code for this can be found in the document by Andrew Pitonyak called Andrew Base found here → Database access using OpenOffice.org

Section ‘8.5. Connections’ (page 98) deals with some of the specifics and ‘8.6.6. Paradox using ODBC’ (page 113) deals with an actual connection. Now although it is for paradox, for MariaDB it is no different except to change the URL line:

sURL = "sdbc:odbc:YOUR_ESTABLISHED_ODBC_CONNECTION"

Now for the user/PW see this post → Connect to mssql (ODBC) database via Macro