[問題] Android資料庫(SQLite)修改程式無法新밠…

看板AndroidDev作者 (別問我的名)時間13年前 (2011/07/19 15:07), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
程式(SQLite.java和main.xml和strings.xml)在網址那(兩者網路空間東西都一樣): 訊6: http://goo.gl/oD3xB MEGAUPLOAD: http://goo.gl/hZWtd logcat錯誤訊息如下: 07-19 06:51:59.349: ERROR/Database(521): Error inserting _Dealer=tyu _Condition=full _Rank=yes _Phone=888888 _Name=abc _Car=987 07-19 06:51:59.349: ERROR/Database(521): android.database.sqlite.SQLiteException: table Taxi has no column named _Car: , while compiling: INSERT INTO Taxi(_Dealer, _Condition, _Rank, _Phone, _Name, _Car) VALUES(?, ?, ?, ?, ?, ?); 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:36) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1536) 07-19 06:51:59.349: ERROR/Database(521): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410) 07-19 06:51:59.349: ERROR/Database(521): at com.example.android.db01.SQLiteTest$2.onClick(SQLiteTest.java:114) 07-19 06:51:59.349: ERROR/Database(521): at android.view.View.performClick(View.java:2408) 07-19 06:51:59.349: ERROR/Database(521): at android.view.View$PerformClick.run(View.java:8816) 07-19 06:51:59.349: ERROR/Database(521): at android.os.Handler.handleCallback(Handler.java:587) 07-19 06:51:59.349: ERROR/Database(521): at android.os.Handler.dispatchMessage(Handler.java:92) 07-19 06:51:59.349: ERROR/Database(521): at android.os.Looper.loop(Looper.java:123) 07-19 06:51:59.349: ERROR/Database(521): at android.app.ActivityThread.main(ActivityThread.java:4627) 07-19 06:51:59.349: ERROR/Database(521): at java.lang.reflect.Method.invokeNative(Native Method) 07-19 06:51:59.349: ERROR/Database(521): at java.lang.reflect.Method.invoke(Method.java:521) 07-19 06:51:59.349: ERROR/Database(521): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 07-19 06:51:59.349: ERROR/Database(521): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 07-19 06:51:59.349: ERROR/Database(521): at dalvik.system.NativeStart.main(Native Method) ==分隔線== 就本來在Android平台測試輸入一筆資料, 但是按新增按鈕,卻沒有這筆資料。 -- 二手書專賣店: http://goo.gl/sclqE -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.17.9.241 ※ 編輯: powerstar 來自: 163.17.9.241 (07/19 15:08) ※ 編輯: powerstar 來自: 163.17.9.241 (07/19 15:12)

07/19 16:51, , 1F
table Taxi has no column named _Car 檢查你的table 吧
07/19 16:51, 1F

07/19 17:48, , 2F
剛問人自己弄好了,我把程式中TaxiDB改成TaxiDB2就ok了
07/19 17:48, 2F

07/19 17:58, , 3F
也感謝1樓大大
07/19 17:58, 3F
文章代碼(AID): #1E9Iqlxx (AndroidDev)
文章代碼(AID): #1E9Iqlxx (AndroidDev)