0

Why is QGIS not refreshing after updating a connected database?

It is a MS Access Database which I connected to QGIS using ODBC. The database contains coordinates of some vessels and they are already visible in QGIS but it is only refreshing when I disconnect and then reconnect the db connection. I am looking for a solution the past few days but I am not possible to find any.

0

I use QGIS to access Filemaker databases via ODBC (also to map vessel data). I find that it will refresh with new data when QGIS is forced to re-draw, by either zooming or panning the map.

I recently detailed how the QGIS-ODBC-Filemaker connection is made here:

Filemaker Interface with QGIS

0

I don't use ODBC actively so this is a bit of a stab in the dark.

With the recalcitrant layer selected, go to the Python console (Ctrl-Alt-P) in QGIS, and try entering the following

iface.activeLayer().dataProvider().forceReload()

This should force the dataprovider (OGR) to reload the data, which I hope should force it to actually go to the underlying (updated) data in Access.

If this does work, then there are ways (using Python startup code in your userprofile or in the project) this could e.g. be bound to a keyboard shortcut, so you could do it whenever needed without having to open the Python console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.