Ask Your Question

Libre Office Base deletes code on restart

asked 2019-08-31 14:49:16 +0200

hnk999c gravatar image

updated 2019-09-02 18:16:06 +0200

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...C:\fakepath\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.image description

edit retag flag offensive close merge delete



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.

Ratslinger gravatar imageRatslinger ( 2019-08-31 17:54:53 +0200 )edit

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.

hnk999c gravatar imagehnk999c ( 2019-08-31 18:09:48 +0200 )edit

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.

hnk999c gravatar imagehnk999c ( 2019-08-31 18:11:00 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-08-31 18:52:54 +0200

Ratslinger gravatar image

updated 2019-09-01 22:16:51 +0200


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:

image description

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:

image description

edit flag offensive delete link more


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.

hnk999c gravatar imagehnk999c ( 2019-09-01 11:18:29 +0200 )edit

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.

Ratslinger gravatar imageRatslinger ( 2019-09-01 17:25:12 +0200 )edit

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.

Ratslinger gravatar imageRatslinger ( 2019-09-01 21:13:09 +0200 )edit

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...

hnk999c gravatar imagehnk999c ( 2019-09-02 17:52:13 +0200 )edit

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).

Ratslinger gravatar imageRatslinger ( 2019-09-02 18:10:43 +0200 )edit

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

hnk999c gravatar imagehnk999c ( 2019-09-02 18:18:19 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-31 14:49:16 +0200

Seen: 95 times

Last updated: Sep 02 '19