This page follows on from database example page.
I found some data, in order to get it into the database I first edited it so that it is in CSV (Comma Separated Variable) format.
I have put a copy here: nutrition.csv
This is a text format where each field is in quotes and separated by commas. Each entry is on a separate line.
First I started OpenOffice.org Calc program and opened the CSV file, this brings up the following dialog box:
This should be set to separate with comma, then press OK, then select all the elements we want to include in the database, press edit->copy or control-c to copy to clipboard.
Leave the Calc program (don't exit) and start Open Office.org Base program. This brings up the following Wizard:
Leave set to "Create a new database" and click on next:
Leave the above default values and click on finish:
Enter name of database and click on OK which brings up the following screen:
In the Database pane click on 'Tables':
Click on the Tables pane and while the cursor is in the Tables pane type control-v. this brings up the following
Set the table name and also set 'Create primary key' then press next
Click on '>>' to select all columns and click on next:
I modified the length of type, barcode and hydrodised to 50.
The fields energykj, energykc, protein, carb, sugar, fat, saturates, fibre and sodium to:
I could not change the Decimal places from 0, I assume this allows any value.
Clicking on Create shows the byWeightQuantities table:
The Calc program can now be exited leaving the base program loaded with the data.
Next stage - go on to: Setting up a form
Other sections are:
|Correspondence about this page|
Book Shop - Further reading.
Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.
Commercial Software Shop
Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.
This site may have errors. Don't use for critical systems.