Address labels creation/printing

Hello,
I am on LO 7.2.3 and Kubuntu 20.10 (also got 7.0.x on my system, which acts the same unsatisfactory way).
I am trying to create labels from data in a MariaDB database table. However there is one big problem: My database is not recognized when specifying dbname, table and table fields. However, I can definitely display the db and table quite normally otherwise, create new tuples, move data to a spreadsheet, etc.
I am “sunk”. Can anybody help?
Regards
H. Stoellinger

Hello,
Thanks for the quick answer! However - as I mentioned in my question —
The connection in Base to my database works completely fine, regarding inserting/updating/selecting tuples. Testing the connection gives a positive feedback. The only thing that puzzles me is that when I test the driver class it comes back with the error message that the driver (mysql-connector-java-8.0.22.jar) cannot be loaded. That’s weird, seeing as I can display my address table o.k…

Check if the class path points to the correct connector: Tools>Options>Advanced>[Class Path]
The path to the library can also be defined on document level. If the following Basic snippet reports some nonexisting path, it may be responsible for the error message. Uncomment the last line to remove the path from the document so it uses the class path from the office options.

Sub Snippet
  Dim oDataSource As Variant
  Dim oSettings As Variant
  Dim sJavaDriverClassPath As String

  oDataSource = ThisComponent.DataSource
  oSettings = oDataSource.Settings
  Msgbox oSettings.JavaDriverClassPath
REM oSettings.JavaDriverClassPath = ""
End Sub

Writer can only connect to a Base database. To connect to another type, you must connect a Base database to the desired database.

  1. Open Base
  2. Select “Connect to an existing database”.
    You will need a driver for MariaDB. Use JDBC as the connection type and the chance to enter the driver name is on the next dialog.
  3. Write a basing query in Base to retrieve your data.

Well, I have been using StarOffice, OpenOffice and - of course LibreOffice for more than a decade - including Base. Years ago I batch-printed address labels (always from a Base Mysql DB, just like now) So, why doesn’t my addresses DB show up in the displayed db-select pop-up form, while other DBs very well are? The only difference that comes to my mind is that “in the old days” there was no MariaDB but simply MySQL.

If other MariaDBs are showing up then there can only be 2 things.

  1. connector configuration
  2. MariaDB/MySQL configuration.

Follow this procedure to check the connector:

  1. Open a new Base and select “Connect to an existing database”
  2. Select JDBC as the method.
  3. Check that the driver is “com.mysql.jdbc.Driver”
  4. Click on “Test Class” If this doesn’t work, then the class is not loaded. If the button is greyed out just retype the last character of the driver class.
  5. Define the connection “host=localhost:3363 dbname=labels” and click “Next”. (Note that the host, port and dbname should be changed to what you have. Also the name of the DB is case sensitive. The “:” and port number can be omitted if the default port is being used)
  6. Enter the username and password if required and click on “Test Connection”
    If the connection test OK, then the tables should appear in your Base. If they don’t, then the issue is with user access rights in MariaDB.

With MySQL (and likely MariaDB) native and JDBC connectors show multiple schema (no multi DB’s in container like PostgreSQL). ODBC connector is still OK. This has not always been the case but not certain if Bug was ever reported.

Using a macro, database connections are possible without Base. For an example see → Python UNO crashes when moving data from cx_Oracle to calc
.
Have used basic also with connections to other databases. Writer, Calc, etc. should be no problem.