0
嘿,我的一個朋友給我提了這個(託尼),我在這裏的任何地方出錯了嗎? ,因爲這是給運行時錯誤。應用程序意外停止。
我可能在語法上出錯。
只是幫助我,提前謝謝。我非常感謝你的迴應。Android應用程序中的SQLite查詢出錯
public boolean checkData(String task1, String dte1, String startTime1)
{
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
//SQLiteDatabase db = null; // get your database instance here.
qb.setTables("table1");
qb.appendWhere("task = ? AND dte = ?");
Cursor c = qb.query(this.db, new String[] { "task" }, startTime1+" BETWEEN stTime AND enTime",
new String[] { task1, dte1}, null, null, null);
int a = c.getCount();
if(a>0)
{
return true;
}
return false;
}
發佈實際的錯誤消息和堆棧跟蹤將會很有幫助。 – krtek 2010-09-30 08:45:29
發佈到堆棧跟蹤,但只是一個快速的猜測stTime和enTime必須是字符串,只要startTime1是字符串,應引用'stTime'和'enTime' – 2010-09-30 12:41:25