Android Question Sqlite-Use Memory

Ydm

Active Member
Licensed User
Longtime User
I am opening Sqlite to memory.
B4X:
SQL1.Initialize("", ":memory:", True)

Then I add the DB.
B4X:
SQL1.ExecNonQuery("attach database '"&Starter.rp.GetSafeDirDefaultExternal("")&"/data.db'"&" as data")

I am deleting the physical db file for security.

I can not use SQL later.

How can I solve this problem? I need to delete the physical file after initialization.
 

Mahares

Expert
Licensed User
Longtime User
If I understand you correctly; You want to delete data.db via a file manager or other means. Don't you have to detach it first?
B4X:
SQL1.ExecNonQuery("DETACH DATABASE data")   'Detach the physical database
Please forgive me if I did not understand your question.
 
Upvote 0

Ydm

Active Member
Licensed User
Longtime User
Sorry. My English is not good. I'm using google translate.
My problem is not to delete it. (File.Delete(Starter.rp.GetSafeDirDefaultExternal(""),"data.db"))
I'm deleting my physical database. I do not delete the memory.
But after this deletion the query does not work. It gives a disk error.

Error: android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 1802)
 
Last edited:
Upvote 0
Top