我已寫入表創建,但是當我試圖從我的屏幕之一訪問表拋出異常。表未創建
即使當我去命令shell提示我無法找到該表。任何線索,我需要做的。
日誌:
W/System.err( 275): at java.lang.Thread.run(Thread.java:1096)
I/Database( 275): sqlite returned: error code = 1, msg = no such table: woman_registration
D/AndroidRuntime( 275): Shutting down VM
W/dalvikvm( 275): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime( 275): FATAL EXCEPTION: main
E/AndroidRuntime( 275): android.database.sqlite.SQLiteException: no such table: woman_registration: , while compiling: SELECT DISTINCT
* FROM woman_registration WHERE (m_name = ? AND f_name = ? and m_age_range = ?)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:46)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1229)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1184)
E/AndroidRuntime( 275): at org.atl.db.DBAdapter.isWomanAlreadyRegisgtered(DBAdapter.java:376)
E/AndroidRuntime( 275): at com.accenturelabs.idoc.RegisterWoman.registerMother(RegisterWoman.java:237)
E/AndroidRuntime( 275): at com.accenturelabs.idoc.RegisterWoman.access$1(RegisterWoman.java:223)
E/AndroidRuntime( 275): at com.accenturelabs.idoc.RegisterWoman$4.onClick(RegisterWoman.java:141)
E/AndroidRuntime( 275): at android.view.View.performClick(View.java:2408)
E/AndroidRuntime( 275): at android.view.View$PerformClick.run(View.java:8816)
E/AndroidRuntime( 275): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 275): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 275): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 275): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 275): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 275): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 275): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 275): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 275): at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 58): GC_FOR_MALLOC freed 18388 objects/947880 bytes in 106ms
W/ActivityManager( 58): Force finishing activity com.accenturelabs.idoc/.RegisterWoman
I/ARMAssembler( 58): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x34d7b0:0x34d86c] in 7148901 ns
發佈您的代碼應用程序。 – 2012-01-07 11:28:26
@bhalkian嘗試刪除所有表格或從FileExplorer data-> data->包名稱 - >數據庫中刪除.db文件,並再次創建啓動應用程序。可能是你的數據庫文件必須已經在你的模擬器中使用少量表創建了 – Maverick 2012-01-07 12:08:46