Android Question Error 1294 for SQL

catyinwong

Active Member
Licensed User
Longtime User
The following error occurs when I try to initialize SQL library. Anyone knows why??
Dim sql1 As SQL
sql1.Initialize(File.DirDefaultExternal, "Testing.db", True)


Error occurred on line: 46 (Main)
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1294): Could not open database
#################################################################
Error Code : 1294 (SQLITE_CANTOPEN_ENOENT)
Caused By : Specified directory or database file does not exist.
(unknown error (code 1294): Could not open database)
#################################################################
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
 

catyinwong

Active Member
Licensed User
Longtime User
But the "TRUE" setting in sql1.Initialize(File.DirDefaultExternal, "Testing.db", True) tells it to create if necessary, isn't it @@
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Based on the error the file Testing.db seems not to be there (File.DirDefaultExternal). Did you make sure it is available?
Did you copy th db from assets to this place before?
I have a feeling his target SDK is 23+ and he needed runtime permissions, but he is using defaultExternal instead of rp.GetSafeDirDefaultExternal("")
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…