6

after moving a spatialite-database to another directory, qspatialite says "Can't connect to Database" / Error unable to open database file. Even no project is open or I try to create a new project. In Qgis browser it lists the spatialite-database but says "database does not exist". I scanned all Qgis project files for the according database, but it does not show up.

The questions are:

  • where are these settings stored?
  • how to change these settings to the correct path?
  • What operating system are you using? – Simbamangu Jun 20 '12 at 14:25
6

Either in the [spatialite] section of ~/.config/QuantumGIS/QGIS.conf in Linux/Unix (perhaps also on OSX) or on Windows in the registry HKEY_CURRENT_USER\Software\QuantumGIS\qgis\SpatiaLite\connections (Windows)

  • On 2.8.2 (Windows) is under HKEY_CURRENT_USER\Software\QGIS\QGIS2\SpatiaLite\connections ... if you delete all connections, qspatialite will remind you of the strange GUI way to make database connections by creating a new Spatialite layer and ignoring the "Replace" warning. – Ben Mearns Oct 30 '15 at 18:12
3

If you don't want to search for the config file, you can also just install the DB manager plugin, from which you can delete the orphaned Spatialite databases. This will allow you to create a new Spatialite database afterwards. You should probably store it somewhere safe so that you won't have to do this again in the future.

  • 1
    I was trying to find the config file too, and something similar worked for me - I was able to delete the orphaned SQLite database from the built-in browser pane - seems like either that, or your solution with DB manager both work. Thanks for the tip! – nicksan Mar 20 '17 at 18:28

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.