2

With 2.14.1 under Windows 10, I am trying to save a .dbf attribute-only table as a .sqlite table. However, the response is an error.

My procedure: right-click the .dbf in the QGIS table of contents and Save As... In the subsequent Save Vector Layer As... panel I click the Geometry Type as "No Geometry", as seen in this screenshot:

enter image description here

Here's the resulting error statement. What am I doing wrong?

enter image description here

1

Can't tell you why your export doesn't work in general, but can give you another way of exporting.

Create the database first via new layer or browser and add the table using the DB-Manager. Use the options button to let the program set the needed options, then you don't have to care about the rest.

The problem is that the save layer as-tool is not yet ideal to work with databases. There is also no option to add data to an existing one. Therefore i would recommend the DB-Manager.

0

The problem is probably that you are keeping "Add saved file to map" as an option. However, wasn't the file actually saved in spite of the error?

Testing this with a loaded non-spatial CSV file (wasn't sure how to get a DBF file loaded as per your example), and doing save-as with an SQLite but keeping "Add saved file to map" ticked, I get the same error.

The requested SQLite file was created in the requested folder.

2
  • @Matte Both answers helped, but I still don't have a final solution. Removing "Add saved file to map" allowed the table to be saved as an SQLite - good! However, I am unable to add that SQLite table to QGIS. Here are the 3 methods tried so far: 1. Add Vector Layer: results in "Invalid data source..." 2. Add Spatialite Layer: results in "Unexpected error when working with: ...sqlite" 3. DB Manager: I can successfully connect to the .sqlite table, see its info in the info tab, and view its contents with the table tab! But r-click, "Add to canvas" results in "...invalid layer...". Thoughts?
    – Stu Smith
    Apr 11 '16 at 19:30
  • @Stu-Smith, this does answer your original question. You are now asking a new question (how to add an sqlite table to QGIS).
    – Simbamangu
    Jun 8 '16 at 7:20

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.