Cannot create layer because "unable to open database file" in QGIS 3.2.0?

The easy solution to your issue is to export using the shapefile format instead of the geopackage format.

See below if you want to know why you're having this issue.


Geopackage is a database format. In one geopackage, you can have many layers. This is different from the shapefile format. Each shapefile layer is a separate file (actually 3-6 files, but you probably already know that).

You must have an existing geopackage before you can add a layer to it. When you try to export as a geopackage layer, QGIS can't find a geopackage to add the layer to. That's why you're getting the error message "unable to open database."

You must create a geopackage before you can add layers to it.

To create a geopackage database, go to the Layer menu > Create Layer > New Geopackage Layer. In the window that pops up, next to click the "..." button next to Database. Choose the folder where you want to put your database and type in a name. Click Save, then click OK.

Now you have a geopackage with one empty table. You can now export layers to this geopackage.

Tags:

Qgis

Error

Qgis 3