Another sqllite questin

jndaniels1

Member
Licensed User
Longtime User
Hi ALL.
can you not run a sqlite db from internal storage? I copy my db from the DirAssets and into DirDefaultExternal. I've tried to copy it to the DirInternal, and it appears to copy , but when I run a sql query, android craps out saying it cannot find the table "main" (yes I do have a table named main).

So far - my app runs great if on external storage.

If I understand, DirInternal and DirDefaultExternal are both read/writable folders, one is just in the phone - other is on the SD card.

What did i miss??

:sign0104: .JND.
I'll admit, i'm glowing noob green here.
 

glook

Member
Licensed User
Longtime User
Yes, an SQLite file should be fine in DirInternal. (just tried it, changing from DirInternalCache that my recent app was already using)

Maybe you could try a test - creating a new file, rather than copying. Might help show what is going on?
 
Upvote 0

jndaniels1

Member
Licensed User
Longtime User
Thanks for the input.

whats strange when I initialize the sql and use the File.DirDefaultExternal I have no problems. But using File.DirInternal, I get a sql error

android.database.sqlite.SQLiteException: no such table: main: , while compiling: Select * from main

Error happens in the avd emulator.

Error: SQL1.Initialize(File.DirInternal, "data1.db", False)
Works: SQL1.Initialize(File.DirDefaultExternal, "data1.db", False)

I just tested on my phone and it works fine. I'm now thinking avd settings.


Thanks
.JND.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…