Modifying table entries from LibreOffice Base, possible?

有些话、适合烂在心里 提交于 2019-12-20 04:37:26

问题


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:


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.



来源:https://stackoverflow.com/questions/33704631/modifying-table-entries-from-libreoffice-base-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!