可以从LibreOffice Base修改表条目吗? [英] Modifying table entries from LibreOffice Base, possible?
问题描述
我已成功将LibreOffice Base与MySQL数据库服务器连接.我已经测试过是否可以从主机修改表(Internet上的免费主机服务),然后在LO Base中刷新表对象时会反映出更改. 但是我的问题是,我可以直接从LO Base修改数据库表吗?我想可以使用LO Base中的sql查询,但是如何?请给我一些见解或教程.谢谢.
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.
推荐答案
更改表的常规方法:
- 工具-> SQL
- 输入
ALTER TABLE
命令并按Execute
按钮.
- Tools -> SQL
- Enter an
ALTER TABLE
command and pressExecute
button.
一种有效的方法,即使它抱怨没有返回结果集:
A way that works, even though it complains that no result set is returned:
- 在SQL视图中创建查询.
- 输入
ALTER TABLE
命令. - 单击工具栏中的按钮将其标记为
Run SQL command directly
.或编辑->Run SQL command directly
. - 关闭查询,然后双击运行它.
- Create a query in SQL view.
- Enter
ALTER TABLE
command. - Click button in toolbar to mark it as
Run SQL command directly
. Or Edit ->Run SQL command directly
. - Close the query and double-click to run it.
我的猜测是也可以使用宏完成,类似于 https://forum.openoffice.org/en/forum/viewtopic.php?f=5&t=75763 ,但使用ALTER TABLE
.
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
.
有关更多想法,请参见 https://论坛. openoffice.org/en/forum/viewtopic.php?f=61&t=37687 .
For more ideas see https://forum.openoffice.org/en/forum/viewtopic.php?f=61&t=37687.
以表格形式插入新行数据比更改表格更容易.首先,请确保此方法有效:
Inserting new row data in a form is easier than altering the table. First, make sure this works:
- 在
Tables
下的表格上双击. - 插入->记录,或在最后一个新行中输入数据.
- Double-click on your table under
Tables
. - 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:
- 在
Forms
,Use Wizard to Create Form
下. - 选择表,然后按
>>
包括所有字段. - 单击
Finish
.
- Under
Forms
,Use Wizard to Create Form
. - Select your table and press
>>
to include all fields. - Click
Finish
.
现在,您应该可以打开表格并将数据输入到最后的新行中.
Now you should be able to open the form and enter data into the final new row.
有关示例的更完整说明,请参见 http ://www.open-of-course.org/courses/mod/url/view.php?id = 786 .
More complete instructions with examples are at http://www.open-of-course.org/courses/mod/url/view.php?id=786.
这篇关于可以从LibreOffice Base修改表条目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!