中打开数据库异常我有问题了解打开数据库时出现什么错误,因为我的程序工作正常,但它显示此错误。任何人都可以帮助我理解这一点。无法在android
我这是怎么检查的主要
private boolean checkDataBase(){
SQLiteDatabase checkDB = null;
try {
checkDB = SQLiteDatabase.openDatabase("Event.db", null, SQLiteDatabase.OPEN_READONLY);
checkDB.close();
}
catch (SQLiteException e) {
eventDB = new DatabaseEvent(this);
}
return checkDB != null;
}
数据库中不存在我得到这个错误,我不知道如何解决?
E/SQLiteDatabase: Failed to open database 'MyACtion.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
你没有在数据库中的辅助类中定义的数据库名称 –
无我从常量接口 – mesa