Open a database file, which connects directly to a MySQL/MariaDB database. Create a new table in Base. Close the connection. Open another connection to MySQL/MariaDB - tested here with phpMyAdmin. Delete the table, which you have created new in Base. Now open the Base file again. Create a macro like this: SUB Tables oDB = ThisDatabaseDocument.DataSource oTables = oDB.getTables() DIM stTablenames() AS STRING stTablenames = oTables.getElementNames END SUB Start the macro watching stTablenames (step by step) You will get a list of all tables - including the table, which is deleted and won't be shown any more in Base GUI. Macro will only read all tables out of content.xml in Base file. Tables, which are created directly in MySQL, not by Base GUI, won't be shown there up to the moment you open this tables and use this tables for input new data or something else. For external databases Base should refresh the list of tables when connecting to the database. The shown tables shouldn't contain tables, which doesn't exist any more. The shown tables should contain all tables, which exist. Entries in content.xml might be used for formatting of cells of the table, so this entries should be deleted by default.
Have confirmed this with: Version: 7.5.1.2 (X86_64) / LibreOffice Community Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded Also noted this occurs with PostgreSQL.
https://ask.libreoffice.org/t/possible-synch-error-between-mysql-and-base/88846/14 > AndrewBase 2.2.4 speaks precisely about this issue. There is a workaround listed > there, which I have slightly modified, and it seems to be working just fine: sub refreshTables() dim dbURL as string: dbURL = ConvertToURL(“C:\filename.odb”) dim oBaseContext as object: oBaseContext = CreateUnoService(“com.sun.star.sdb.DatabaseContext”) dim oDB as object: oDB = oBaseContext.getByName(dbURL) dim oDoc as object: oDoc = oDB.DatabaseDocument dim oDisp as object: oDisp = createUnoService(“com.sun.star.frame.DispatchHelper”) dim oFrame as object: oFrame = oDoc.getCurrentController().getFrame() oDisp.executeDispatch(oFrame, “.uno:DBRefreshTables”, “”, 0, Array()) end sub Download AndrewBase from https://www.pitonyak.org/database/ - 2.2.4 Refresh the tables
(In reply to flywire from comment #2) > https://ask.libreoffice.org/t/possible-synch-error-between-mysql-and-base/ > 88846/14 > > > AndrewBase 2.2.4 speaks precisely about this issue. There is a workaround listed > there, which I have slightly modified, and it seems to be working just fine: > > sub refreshTables() … Have tested this one. Is the same as using View → Refresh Tables. It doesn't solve the problem. All old entries in the database file will be there. Entries in content.xml are like this: <db:table-representation db:name="Musik.MUSIK"/> And this has nothing to do with the tables, which are shown. Many times ago I had a database 'Musik' on my system. It isn't there any more but I connected the *.odb-file to this database in the past. So the table-representation is almost there.