I made some further investigations with my Samsung Tab S2 with an external SD card and Android 7.0.
I added a subfolder on the SD card and a database in it.
Running the program I get the same error!
It is a permission limit in Android.
Then I checked for the GetSafeDirDefaultExternal:
Private rp As RuntimePermissions
SafeDir = rp.GetSafeDirDefaultExternal("SQLite")
Added the database file.
With the FileDialog I see the database file, I select it.
SQL.Initialize(Dir, FileName, False) doesn't throw an error, before the error was thrown here, nor does DBUtils.ExecuteListView.
But it seems that the database is considered as empty, no table.
I tested with
Private curs As Cursor
curs = SQL.ExecQuery("SELECT * FROM persons")
The Cursor is empty.
Then, to check write permissions, I saved a simple text file in the same folder and read it back. This works!
So, to me it seems that there is a problem reading databases from an externa SD card.
I'm afraid that Erel needs to look at this.
Attached, my test project. The "persons.db" database, I used, is included in the zip file.