我是一個初學者在android編程,我面臨這個錯誤試圖插入到我的sqlite數據庫。sqlite返回需要幫助:錯誤代碼= 1,msg =表沒有列名稱
sqlite返回:錯誤代碼= 1,msg =表MobileHouseVisit沒有列老人_date_time。
對於前3列,沒有問題,直到我添加更多的列。這就是爲什麼我評論它。我檢查了間距,所有東西都看起來不錯。我搜索了一下,但仍然沒有得到任何幫助。
下面是我的代碼
private static final String DATABASE_NAME = "silverCareMgt.db";
private static final String DATABASE_TABLE = "MobileHouseVisit";
private static final int DATABASE_VERSION = 1;
private SQLiteDatabase _db;
private final Context context;
public static final String MOBILE_HOUSE_VISIT_ID = "_id";
public static final int COLUMN_KEY_ID = 0;
public static final String ELDERLY_NAME = "elderly_name";
public static final int COLUMN_NAME_ID = 1;
public static final String ELDERLY_NRIC = "elderly_nric";
public static final int COLUMN_TEL_ID = 2;
public static final String ELDERLY_DATE_TIME = "elderly_date_time";
public static final int COLUMN_DT_ID = 3;
//public static final String PHYSICAL_HEALTH_STATUS ="physical_health";
//public static final int COLUMN_PHY_ID = 4;
//public static final String MENTAL_HEALTH_STATUS ="mental_health_status";
//public static final int COLUMN_MENTAL_ID = 5;
protected static final String DATABASE_CREATE = "create table " + DATABASE_TABLE +" ("+
MOBILE_HOUSE_VISIT_ID + " integer primary key autoincrement, "+
ELDERLY_NAME + " TEXT NOT NULL, "+
ELDERLY_NRIC + " TEXT NOT NULL, " +
ELDERLY_DATE_TIME + " TEXT NOT NULL);";
//+ PHYSICAL_HEALTH_STATUS + " TEXT, "
//+ MENTAL_HEALTH_STATUS + " TEXT);";
進入? – dilix 2012-08-01 11:46:10
嘗試擦除手機上的應用程序數據或卸載應用程序,然後再次嘗試解除所有列的註釋。 – 2012-08-01 11:47:10
我該怎麼做?對不起我新..我沒有任何問題插入數據,直到我取消對病房 – user1568459 2012-08-01 11:50:24