有关SQLite数据库,没有这样的表的问题: [英] problem about sqlite database, no such table:

查看:204
本文介绍了有关SQLite数据库,没有这样的表的问题:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打开一个SQLite数据库,并使用rawquery来获取数据。

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

但log.e显示信息:

But the log.e show the information:

android.database.sqlite.SQLiteException:没有这样的表:类型:

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

不过,我真的有这个表。

But, I really have this table.

我也尝试使用其他的SQL,但也得到了错误消息,如

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

android.database.sqlite.SQLiteException:没有这样的表:商场:

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

我相信有这两个表。 那么,为什么收到错误信息?

I am sure there are this two tables. So why get the error message?

推荐答案

如果这是在模拟器上,使用DDMS文件资源管理器或亚行拉下载的副本数据库文件,并确认其内容。

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.

和我的箱子一个自定义SQLiteOpenHelper   这个文件复制到路径:   /data/data/com.SGMalls/databases/mallMapv2.sqlite

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

如果您正试图复制文件的 SQLiteOpenHelper 的onCreate(),你是为时已晚。在此之前,我会做到这一点。

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

所以复制文件code可不行   复制完整的文件。

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.

这篇关于有关SQLite数据库,没有这样的表的问题:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆