Why is my form marked "read-only"?

Discuss the database features
Post Reply
OldGrantonian
Posts: 34
Joined: Wed Apr 02, 2008 11:06 am
Location: Highlands

Why is my form marked "read-only"?

Post by OldGrantonian »

I can enter data into my form fields. However, File > Save is always greyed out.

The only time that I can save is when I close the form. I am then given the option to save.

I have automatic save activated, but I would be much happier if I could press Ctrl+S frequently. (I have some unpleasant experience of the Writer automatic save.)
.
OOo 3.1 with Windows XP Home
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: Why is my form marked "read-only"?

Post by r4zoli »

OOo Base uses Writer document in read-only mode when you enter data into database.
The read-only means, only form controls connected to database fields working, the form layout not changing.
The data saved into table when saves record.
The save as only working with form layout changes.
If you open form in edit mode, you can change form layout, and in that case form not working as form (only in that case if you switch off design mode). In this case you can copy whole form out of odb file, with Save as..., into file system - to create a standalone form.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
OldGrantonian
Posts: 34
Joined: Wed Apr 02, 2008 11:06 am
Location: Highlands

Re: Why is my form marked "read-only"?

Post by OldGrantonian »

r4zoli wrote:
The data saved into table when saves record.
This does not work for me :(
Here is my test:

• Open the directory containing the ODB file. Note the file time.
• Open the directory containing the backup file. Note the file time
• Open the database form
• Change a record
• Click the "Save Record" icon on the Form Navigation toolbar
• Refresh the two directories specified above
• The times do not change :(
• Close the form. Close the control panel
• Now the time for the ODB file changes. (The backup directory is always empty.)
The save as only working with form layout changes.
If you open form in edit mode, you can change form layout, and in that case form not working as form (only in that case if you switch off design mode). In this case you can copy whole form out of odb file, with Save as..., into file system - to create a standalone form.
Very interesting information. I tried that :)
.
OOo 3.1 with Windows XP Home
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Why is my form marked "read-only"?

Post by Villeroy »

The "embedded HSQLDB" type of database is just another way to connect with a database that is external actually.
You "open" the database file.
You access the tables for the first time when viewing anything related to the tables. Notice the small delay. Watch the temporary directory specified in Tools>Options...OOo>Paths
OOo extracts the whole database content (tables, views, indices) to a temporary directory, starts up a HSQL server, connects to the server and queries the just extracted database.
Normally, you would have the HSQL database server as independent software up and running, connect Base or any similar tool to the server and query whatever database the server has to serve. Same with similar software like SQLite, MySQL, PostgreSQL, Oracle, MS SQL Server, ...

General scheme, remote back-end on the left, local front-end on the right.:
[remote data]<->[remote server]<-> |network| <->[local driver]<->[local front-end]

Single-user desktop database (local, embedded HSQLDB):
[extract /tmp/data]<->[OOo-HSQL server]<->[OOo HSQL-driver]<->[OOo forms, reports, queries]
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
OldGrantonian
Posts: 34
Joined: Wed Apr 02, 2008 11:06 am
Location: Highlands

Re: Why is my form marked "read-only"?

Post by OldGrantonian »

Villeroy wrote:The "embedded HSQLDB" type of database is just another way to connect with a database that is external actually........
Very useful and interesting info. Thanks for that :)

I think I'll just close and re-open my database frequently, to make sure nothing is lost. As a miserable Scot, I prefer to find workarounds in open source software than pay anything to Bill :)
.
OOo 3.1 with Windows XP Home
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: Why is my form marked "read-only"?

Post by r4zoli »

I tried to simplify situation, the correct way, that Villeroy explained well, with some additions.

OOo Base odb file contain database folder where properties,script, data, backup files stored.
When you open odb file and click on tables or start some query Hsqldb starts read script (data structure) and data from files.

During data input when you save records, all changes stored in log (temporary) file.

When you close odb file the log file processed and all changes copied to script and data file, same happens if you use Tools>SQL... command window, and execute SHUTDOWN COMPACT - SQL command.

This process is broken when OOo crashes, HSQLDB not closes, in this case log file not processed, during next startup will be processed if you lucky. If log file damaged than all your changes lost. More about it in [Tutorial] Recovering a damaged odb file
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
OldGrantonian
Posts: 34
Joined: Wed Apr 02, 2008 11:06 am
Location: Highlands

Re: Why is my form marked "read-only"?

Post by OldGrantonian »

r4zoli wrote:During data input when you save records, all changes stored in log (temporary) file.
In a closed database, my ODB file does not contain a database/log directory.

When the database is open, I still cannot see a database/log directory. Here is my test:

• Note the filetime for an ODB file.
• Launch the file in Base. Open a form. Make some changes to the data. Save the record.
• While the database is still running, examine the contents of the ODB file using Archive Manager (in Ubuntu).
• There is no log file in the ODB file. All file times are unchanged.

So where is the log file? (Maybe it doesn't matter if the user can never access it.)
This process is broken when OOo crashes, HSQLDB not closes, in this case log file not processed, during next startup will be processed if you lucky. If log file damaged than all your changes lost. More about it in [Tutorial] Recovering a damaged odb file
Some of your comments in the tutorial worked for me, and some didn't.

I opened the database and made some changes without saving. I switched off my laptop.

I examined the directory containing the ODB. I'm sure that there were no temporary files.

When I rebooted, and re-opened the ODB file, the database launched with all changes present :)

Maybe the temporary files are not saved in the same directory as the ODB file? (I'm using Ubuntu.)
.
OOo 3.1 with Windows XP Home
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: Why is my form marked "read-only"?

Post by r4zoli »

Maybe the temporary files are not saved in the same directory as the ODB file? (I'm using Ubuntu.)
Some files in op system temp folder, some in memory.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
OldGrantonian
Posts: 34
Joined: Wed Apr 02, 2008 11:06 am
Location: Highlands

Re: Why is my form marked "read-only"?

Post by OldGrantonian »

r4zoli wrote:Some files in op system temp folder, some in memory.
There are files are in /tmp

At database startup, it looks as if there is one properties file and one database schema. After that, individual files are added for each SQL INSERT/DELETE action.

So, if the ODB file is non-corrupt at startup, it should be possible to recreate a broken database by incrementally applying the SQL files in the correct sequence based on timestamp. Clever :)
.
OOo 3.1 with Windows XP Home
Post Reply