开发者

SQLite problem (doesn't update)

I have made an SQLite database file with some testdata in it. When I use it in my application it goes well.

Next I have inserted a new row with data into my table with an SQLite manager. Here's where the problem is. When i run my application now, the new data doesn't appear. It's still all the old data (without th开发者_如何学Ce newly inserted one).

Does anyone know why the SQLite file isn't updated (Or maybe it's updated but doesn't show the data)?

Update:

I use the SQLite manager in FireFox. I've inserted it with that manager, and when i query the select * from table it shows the new data. I use the following command to open my database

var db = Titanium.Database.install('../test2.sqlite', 'test');


What is the current path when you open the database? ../ refers to the parent folder; are you absolutely certain that is the same folder where you’ve been creating a database using SQLite Manager? SQLite doesn’t error out if you open a non-existing database; it’ll just create a new, empty, one.

Use a full, absolute path, and try again.


this is typically i think. your database seems to be cached. you should change the name

var db = Titanium.Database.install('../test2.sqlite', 'test_v2');

or delete the cached database.


You don't need to rename your database.

You can try to delete the app in your simulator or emulator and install the app again. It worked for me. Since the app still has the old database. Re-installing the app with the new data (i.e. columns, rows). I use SQLite Manager plugin in Firefox as well.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜