开发者

Error in execSQL in running app on phone

I've created an app that will set an alarm for a specified date and store some data for this alarm in开发者_如何学Python a database. The app works fine in my emulator but when I try to run it on my phone it crashes. I managed to trace the source of the crash to this line of code:

String newTableQueryString = "create table" + TABLE_NAME + " (" + TABLE_ROW_ID + 
"integer primary key autoincrement not null," + TABLE_ROW_ONE + " text" +");";
// execute the query string to the database. This is what's causing the crash
db.execSQL(newTableQueryString);

Can someone help me with this problem?

Thanks,


Looks like you're lacking spaces in some places, so final SQL string migth be incorrect. For instance add space after create table string, like here

String newTableQueryString = "create table " + TABLE_NAME + ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜