cannot modify database in openoffice.org base

Asked by Joe

I having been modifyimh data in a database using openoffice.org Base. The database was created in Base. All of a sudden I cannot make any changes to the data. The database does not say it is read-only when I open it. I verified the file permissions and there were set to read and write. I am able to modify data in a Calc spreadsheet. I just created a test database and everything seems fine. How do get back the ability to modify data in my database?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openoffice.org Edit question
Assignee:
No assignee Edit question
Solved by:
DrewJensen
Solved:
Last query:
Last reply:
Revision history for this message
Tom (tom6) said :
#1

Hi :)

Is there enough space on the partition where the database is saved?

Regards from
Tom :)

Revision history for this message
Joe (jgsylvesterjr) said :
#2

Tom:
There is over 130 GB on my partition. I copied the file to my external hard drive, and still cannot modify.
Joe

Revision history for this message
DrewJensen (atjensen) said :
#3

Hi,

When you say you can not modify data - can you tell exactly what happens?

Does opening a table directly not offer the ability to edit or is it rejected when you try to post?

Also, have you compacted your database recently:
1 - make a copy of the Base file.
2 - open the original
3 - Tools->SQL
4 - enter the command SHUTDOWN COMPACT
5- when this is finished, close the Base file and open it again

Thanks

Revision history for this message
Tom (tom6) said :
#4

Hi :)

Sorry i had to get the most obvious answer out the way quickly there! Quite often it is the stupid answer that works after having been digging around in complexities. We have all been there i'm sure. Good to see a proper answer now :)
Regards from
Tom :)

Revision history for this message
Joe (jgsylvesterjr) said :
#5

Hi:
Thanks for your suggestion. I followed your steps above to STUDOWN COMPACT the database file and re-opened it. There was no change. Specificaaly, this is what I am doing:
1. Launch Openofffice.
2. Open the database file into Base
3. Select Tables
4. Select table LoginAccounts (name of table)
5. Right-click on LoginAccounts, and select Open
6. Table opens.
7. I attempt to select any record, any field to modify
8. Normally, the selected filed is highlighted when selected. Not in this case.
9. When I click on any filed, the cursor briefly turns to a icle with a line through it.
10. I am not able to change anything.

Revision history for this message
DrewJensen (atjensen) said :
#6

Well, the only thing that comes to mind is if the lock file is not being created.

If your database is foo.odb, and with it closed, look into the directory it's in and check for foo.lck, if found delete it.
Open the Base file, now look at that directory again, is there a foo.lck?

Revision history for this message
DrewJensen (atjensen) said :
#7

ok - one more thing the lock file is not created when the odb file is opened, but only when the table are accessed for the fist time, so after opening the base file, be sure to go to the tables section before looking for the .lck file.

Drew

Revision history for this message
Joe (jgsylvesterjr) said :
#8

With the database closed, there is no .lck file in the directory. I open the database file, select Tables->LoginAccounts, and there is a .lck file in the directory.
Joe

Revision history for this message
Joe (jgsylvesterjr) said :
#9

I completely removed openoffice.org Base, and re-installed it. There was no change in my problem.
Joe

Revision history for this message
DrewJensen (atjensen) said :
#10

OK - well, let's back up a second.

Your running the OO.o 3.2 (or 3.1.1) out of the Ubuntu repos - yes?
Could you check on which version of a java runtime is being used.
Check under Tools>Options>OpenOffice.org>java and which JRE is actually selected?

Thanks

Revision history for this message
Joe (jgsylvesterjr) said :
#11

I am running openoffice 3.2.0 that was upgraded from 3.1 when I updated to Lucid 10.04. Checking the Java version: 1.6.0.18.
Joe

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#12

try:

gksudo oobase

See if you can edit the file now.

you may also want to run:

lsof | grep -i filename

to see if the file is in use.

Revision history for this message
DrewJensen (atjensen) said :
#13

ok - we have the same systems then (Ubuntu Studio 10.04) here.

So - this quit right after the update to OO.o 3.2? (or maybe one of the ubuntu updates that have been coming with the 10.04 release - I'm updating daily here).

There are some issues with 3.2 regarding forms, and an issue with dates - but have not seen this 'just won't edit' problem.

Do you recall by chance which version of OO.o you created the database in?

Also - you could try an experiment.

Create a new Blank base file under 3.2
With the new file open, open the file with the problem.
Drag and Drop the table that you tried to open in the old file to the new one, when the copy data wizard starts simply hit 'finish' and let it copy in structure and data as default.
Now can you edit this table in the new Base file?

Revision history for this message
Joe (jgsylvesterjr) said :
#14

Regarding actionparsnip suggestions: I am unable to modify and data in the database even when opening Base via gksudo. The lsof produced no results.
Joe

Revision history for this message
Joe (jgsylvesterjr) said :
#15

I as best that I can remember, this database was created in OO base under 3.1 or maybe even 3.0. It was before 3.2. As far as opening a new file, and copying original table to new file, I am able to modify the data in the new file fine.
Joe

Revision history for this message
DrewJensen (atjensen) said :
#16

Sorry for doing this 20 question style, but can't see a better way.

if you open the original file (or a copy of it, even better) and open the table definition in EDIT mode.
Select the table name, right click, select EDIT from the context menu.

Does the file have a Primary Key still? (I gotta think the answer is yes because of the copy experiment but..)

Revision history for this message
Joe (jgsylvesterjr) said :
#17

I opened a copy of the original file. I selected the table, right-clicked on it, and selected Edit from the context menu. There is a key (ID), but there is no specific indication that the field is a key or a primary key.
Joe

Revision history for this message
DrewJensen (atjensen) said :
#18

ok - well, that is a problem.

Simple answer is = re-create the PK on the ID field.

One question then before we go to fix it - was this field setup as an auto_increment?

if not just add the PK attribute (in the table editor, right click on the row marker area [far left] of the ID row, use the context menu to add the PK)

If it was - but now doesn't show that way in the table definition editor - you will need to do this with an SQL command.

Let me know

Thanks

Drew

Revision history for this message
Joe (jgsylvesterjr) said :
#19

I selected the table, opened it for edit. I right-clicked on the row marker, and selected Primary Key. I attempted to close. OO asked if wanted to save changes. I enetered Yes, and I get the following error message: Constraint not foundtable has no primary key in statemen[ALTER TABLE "LabelAccounts" DOP PRIMARY KEY] and more information: SQL Status: S0011
Error code: -61, and the error message repeats.
What is the SQL command(s) to set primary key (assuming that will solve the prioblem)?
Joe

Revision history for this message
Best DrewJensen (atjensen) said :
#20

OK - quick step #2 (this can fail also..)

For reference the HSQLdb documentation (this is an HSQldb database, right and not a dBase file?) can be found at
http://hsqldb.org with details on the ALTER TABLE command. This is the command you will need to use.

BUT - if this table's ID column is not used as a reference in any other tables then you can just drop the column, add the column and make it Auto value when you do. this will automatically create the PK - The values in the new ID field may *NOT* be identical as to the old ID field.

If you want just to add the Primary Key constraint to the current field then

Lets assume the table name Table1 so to add a primary key to field ID

Open the SQL Window and enter
ALTER TABLE "Table1" ADD PRIMARY KEY( "ID" )

execute the command.

Revision history for this message
Joe (jgsylvesterjr) said :
#21

Thanks DrewJensen, that solved my question.

Revision history for this message
Joe (jgsylvesterjr) said :
#22

I executed the SQL command you suggested (this is an HSQldb), and I am now able to modify the data in my database!! Thanks to you, Tom and actionparsnip for all the assistance today on my problem. I really appreciate it.
Joe

Revision history for this message
Tom (tom6) said :
#23

WooooHooo, congrats guys !!!
Superb :))