它老說我SQL語法有問題,可是我對照網上寫的折騰半天也沒發現錯在哪裡啊。
新手求賜教,謝謝!
附上代碼
@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL("CREAT TABLE IF NOT EXISTS notepadtable(id int,"
+ "title varchar(20),"
+ "content varchar)");
System.out.println("creat database");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
db.execSQL("DROP TABLE IF EXISTS"+"notepadtable");
onCreate(db);
}
錯誤報告看不了就看這個:
12-18 01:14:04.340: E/SQLiteLog(4222): (1) near "EXISTSnotepadtable": syntax error
sqlite 語法錯誤
----------------------同志你好,我是CSDN問答機器人小N,奉組織之命為你提供參考答案,編程尚未成功,同志仍需努力!