Modifying table entries from LibreOffice Base, pos

2019-03-05 10:38发布

I've successfully connected LibreOffice Base with MySQL data base server. I've tested if I modify my table from host (free hosting service on internet) then the changes are reflected when refreshing the table object in LO Base. But my question is, can I modify DB table directly from LO Base? I guess that it's possible using sql queries from LO Base, but how? Please give me some insights or tutorials. Thanks.

1条回答
何必那么认真
2楼-- · 2019-03-05 11:14

The normal way to alter a table:

  1. Tools -> SQL
  2. Enter an ALTER TABLE command and press Execute button.

A way that works, even though it complains that no result set is returned:

  1. Create a query in SQL view.
  2. Enter ALTER TABLE command.
  3. Click button in toolbar to mark it as Run SQL command directly. Or Edit -> Run SQL command directly.
  4. Close the query and double-click to run it.

My guess is it could be done with a macro as well, similar to https://forum.openoffice.org/en/forum/viewtopic.php?f=5&t=75763 but using ALTER TABLE.

For more ideas see https://forum.openoffice.org/en/forum/viewtopic.php?f=61&t=37687.

EDIT:

Inserting new row data in a form is easier than altering the table. First, make sure this works:

  1. Double-click on your table under Tables.
  2. Insert -> Record, or enter data in the last new row.

If Insert -> Record is disabled, then you need to set up the table for editing. Make sure that your connection to the database allows editing. Also the table must have a primary key.

Once you can insert records in Table view, it's time to create the form:

  1. Under Forms, Use Wizard to Create Form.
  2. Select your table and press >> to include all fields.
  3. Click Finish.

Now you should be able to open the form and enter data into the final new row.

More complete instructions with examples are at http://www.open-of-course.org/courses/mod/url/view.php?id=786.

查看更多
登录 后发表回答