Refresh Writer ODBC Table Data

Hello,

I have created a document in writer where I have a table that is displaying the result of a Base query. The data is correct when I initially drop the query into the document. However, the document does not refresh the data by re-running the query when the document is opened. The only way I have found so far to refresh the data in the document body is to delete the table and drop it back in again. If I use the refresh button with the datasource window open(F4), the table in the datasource window updated correctly, but the data in the document body does not.

What can I do to fix this?

Thanks in Advance.

With the datasource window open there are two refresh buttons. One refreshes the document table and the other (on the toolbar above the datasource section) refreshes the datasource table (at least in my LO 4.0.3.3). You can enter changes in either the document table or the datasource table then refresh the other to see the changes. Closing and reopening the datasource table also refreshed it. If you happen to have the source .odb document opened then you need to refresh it separately (or close/reopen the table in the .odb document).

You specified ODBC in your question. I tested this with the embedded HSQLDB database and with MySQL (using the native connector).

I’m running LO 4.1.0.4. The query I am running resides in Base, but the data resides in a MySQL database connected using ODBC. In my version, the refresh button that opens with the datasource window refreshes the table in the datasource window. I do not have a second refresh button anywhere. Can you tell me which toolbar it is on?

I believe it is on the Form Navigation toolbar. An alternative is to add a push button control whose action is to refresh the form.

I have this feeling that I am not embedding this data into the document correctly. I am dragging the query from the left pane of the datasource window and dropping it into the document. Is that the correct way to do it? either that, or there is an option somewhere the I need to reconfigure…

Dragging the query inserts a copy of the current state of the query. Try inserting a table control instead.
Toolbars on: Form Controls;Form Design;Form Navigation. Design mode on. In Form Controls click on More Controls. Click on Table Control. Drag the cursor over a space in your document to make space for the table. Choose your data source, query and fields. This links the table control to the data source so that the updating works as described above.

I don’t see where it is possible to configure a table control to point at a datasource

What version are you using? In LO 4.0.3 when I insert a table control into a new .odt document I get a Table Element Wizard dialog that lets me choose the data source. Older versions (not sure when it changed) don’t have the wizard. In that case, edit the form, right-click the table control and choose Form from the context menu then the Data tab. You can then choose a data source from those registered. You may then need to add data columns manually.

Looks like I have it now. Your last comment about the wizard was very helpful. I had the wizards turned off on the ‘Form Controls’ toolbar. Using the wizard to create the table showed me how to properly configure the datasource.

Thanks for hanging in there with me!

Menu/Tools/Update/Links

For me, Links is greyed out. Why would that be?

Please what options are not greyed out?

Menu/Tools/Update/Links is greyed out for me.

The answer to my problem was to make sure all form toolbars were on, make sure ‘Use Wizards’ was turned on using the ‘Form Controls’ toolbar. Then insert a table control using the wizard and configure the datasource to point at the query in my LO database.