Libre Office Base deletes code on restart

I am in the process of analyzing the usefulness of Base. I discovered ACCESS2BASE library. Using this I started developing a database. This database uses a lot of entities. Today I discovered that Base with Firebird and ACCESS2BASE does not allow yoy to have relationships on more than 1 field (bummer! in MS Access that has been made years ago). Being fed up with developing for a while, I closed everything down, shut the computer and had a meal.

On restart the full library of modules was empty. Nothing there any more. 2 Questions:

  1. Why act as if you can have relations with more than one field but fail to do so?
  2. How is it possible that a module is emptied without my saying so.

A somewhat hazardous system, Base seems to me…Aantekening 2019-09-02 174003.jpg. This is how relations can look like in MS Access. This does not work in Base wik the Relationtool, although it looks like it was built to accomodate it. And i succeeded in adding a picture.

Hello,

You do not mention which specific LO version you are using and it is an educated guess the OS is Windows but which one?

Relations deal mainly with the database used. Have not seen any problems with Firebird embedded regarding your statement of multiple relationships. Please provide example.

Also have not experienced (years of Base coding usage) or to my recollection seen where code was lost except in the case of human error or something such as a power outage.

Ahh… LibreOffice 6.2 is the version. It’s Windows 10. I’m using the relations interface in Base to define the relationships, not SQL code. The menu option Relations muddles relations up but entering the fields makes it appear this work. But it does not. Example is very simple: Book in a series (Batman 100) and then contents (Book 100 story The Joker is Wild). Book and number are two keys that should also appear in the content, together with the story id. Now i’m obliged to create singular keys of long integer type. That reminds me of Paradox in the 80s/90s.

By the way. Of course I use backups. So little code was lost. Losing the code gives me the feeling the software is not as robust.

Hello,

It is possible I am still not understanding your situation. When creating relationships in Base, I use menu Tools->Realtionships.. and do not do this in the table design section.

Here is a sample of what I believe you are questioning (please advise where wrong):

sample ----- RelationTest.odb

Edit 2019-09-01:

To further show the problem as stated in the comments, using the graphical interface:

By reversing the ALTER Table & Reference using (used in Tools->SQL):

Alter Table "book" Add Foreign Key ("series_link", "issue_num_link") References "issue" ("series", "issue_number")

The FK is added:

I understand what you are getting at. Indeed, if one uses single keys to identify the records it is a piece of cake to refer to a reference table. My database is loaded with these kinds of reference tables. But if you don’t want to use these, but the name of the series (Batman) as a reference table to the issue (Batman 100) and the issue table uses series and issuenumber as compound key which is agan used in the contents (one or more stories) that each have a identifier it is to much for Base and …. not for MS Access (perhaps Firebird allows this as it follows SQL). So the problem starts with compound keys. Part of the normalisation techniques in databases. I tried to add an example but I don’t know how to insert a file here.

To add a sample, Edit your original question. Use the paper clip icon on the toolbar to add sample.

Also insure all relative information is presented. Now you seem to have added another table and finally mentioned this regards Compound keys (not apparent earlier). Firebird should be able to handle → See Referential integrity section. Base may have a problem since Firebird is still undergoing development with regard to integration.

As for loss of code, to examine any further, must be able to reproduce the problem. If this can be done, please provide those steps.

Have done some further testing with the Compound FK. Compound Primary key seems to present no problem. Creating a Compound FK using the graphical interface presents an error and should be reported as a Bug on Bugzilla (if not already done by someone else). The error shows an ALTER statement & the “Table” and “References” seem to be reversed.

However, creating this FK using SQL seems to work correctly. As previously stated, Firebird in Base is still undergoing some development.

Your last comment is probably the answer. the graphical interface is probably the problem. On my search i found references to multikey relations with Firebird. See my access example above…

As mentioned in my comment above (regarding adding a sample), adding an image is the icon to the left of the paperclip. You add images (usually not very helpful) in questions (just Edit question) and answers (only to respond to original question).

Thanks. I’m learning. Next time I’ll add this in responses. I suppose this works there too?