Cannot add new records

Discuss the database features
Post Reply
FTB2
Posts: 2
Joined: Sun Jun 23, 2019 11:48 pm

Cannot add new records

Post by FTB2 »

First, i am very new to databases. I created a database from an excel spreadsheet and created a report to meet our needs. I cannot add new records.

I did a search of this topic in this forum and tried some of the suggestions to no avail. I did see something about a "primary key" in my searches, but have no clue on how to reset, etc. What am I doing wrong?
Libre Office version 6.2.4.2 on Windows 10
User avatar
MrProgrammer
Moderator
Posts: 4901
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Cannot add new records

Post by MrProgrammer »

Hi, and welcome to the forum.
FTB2 wrote: I created a database from an excel spreadsheet and created a report to meet our needs. I cannot add new records.
If you used File → New → Database → Connect to an existing database → Spreadsheet, the data in Base is read-only. You add new records to the "database" by modifying the spreadsheet.
[Tutorial] Read-Only in Base

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
FTB2
Posts: 2
Joined: Sun Jun 23, 2019 11:48 pm

Re: Cannot add new records

Post by FTB2 »

Ok, I understand. How can I create a database from a spreadsheet with it not being read-only?
Libre Office version 6.2.4.2 on Windows 10
UnklDonald418
Volunteer
Posts: 1546
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Cannot add new records

Post by UnklDonald418 »

The reason the database table is read only is that it has no Primary Key.
One solution is to copy the database table into one with a Primary Key.
Select the table name and press <Ctrl>C to copy it into the Windows clipboard
Press <Ctrl>V to paste the clipboard contents
That should open a Copy Table dialog.
Duplicate table names are not allowed so you will need to change the Table name
Select the Definition and data option
Select Create primary key, the default Name is fine.
Select the Create button.
Right click on the new table and select Edit.
In the table design GUI select the ID field
In the lower pane of the GUI window change Auto Value to Yes.
Save and close the table.
You should now be able to edit the new table in Base.
Editing table data directly offers very few formatting options.
To have more formatting control you need a Base Form.
You could use the Wizard to Create Form to generate a basic data form for data entry/edit.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Post Reply