tags:

views:

538

answers:

2

I open a sqlite database and use rawquery to get data.

But the log.e show the information:

android.database.sqlite.SQLiteException: no such table: types:

But, I really have this table.

And i also try to use the other sql ,But also get the error message such as

android.database.sqlite.SQLiteException: no such table: malls:

I am sure there are this two tables. So why get the error message . Thank you very much. Thanks

+1  A: 

If this is on the emulator, use DDMS File Explorer or adb pull to download a copy of the database file and confirm its contents.

And i crate a custom SQLiteOpenHelper to copy this file to path : /data/data/com.SGMalls/databases/mallMapv2.sqlite

If you are attempting to copy the file in SQLiteOpenHelper's onCreate(), you are too late. I would do it before then.

So the copy file code may be can not copy the complete file.

It is more likely you would get an error about a corrupt file in that case.

CommonsWare
OK. thanks very much. So. if i want to test this code in device. Also need paste the sqlite database in the device first? O...i need to read a tutorial carefully Thanks
Hi.As you said: I use to ddms file explorer to pull the database file. And i find there are three floder : data,sdcared and system. So any one is ok? and the path of this file also is /data/data/com.SGMalls/databases/mallMapv2.sqlite?Thanks. Pls help me