作者powerstar (别问我的名)
看板AndroidDev
标题[问题] Android资料库(SQLite)修改程式无法新增资料问题
时间Tue Jul 19 15:07:18 2011
程式(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)
1F:推 afz096:table Taxi has no column named _Car 检查你的table 吧 07/19 16:51
2F:→ powerstar:刚问人自己弄好了,我把程式中TaxiDB改成TaxiDB2就ok了 07/19 17:48
3F:→ powerstar:也感谢1楼大大 07/19 17:58