0

I was following this tutorial in order to integrate a pre made database to my Android App.

Everything was going well until it asked me to rename my Primary Key Field to "_id". Well for one I don't have a PK (I know it's bad DB practice), and two, the PK is not an integer type, giving a type mismatch error. Now, I tried to rename one of my fields (non integer) to "_id" and now I can't rename it back. Also, I tried removing an extra field that I don't need and it gives me this error:

Error removing field. Message from database engine: table TEMP_TABLE already exists

or this

Error editing field. Message from database engine: table TEMP_TABLE already exists

Not quite sure how to work this out since I'm not familiar with using the terminal to work with databases. I tried looking around and there are no extra unaccounted for tables so I don't know where these are coming from.

4

1 に答える 1

1

You should get SQLite Manager (a FireFox extension) to work with your DB on your desktop, it's free and works pretty well. It's got a fairly reasonable GUI... so it's much more friendly than using the command line.

And yeah, android wants a primary key field called "_id" and it needs to be an integer. It seems they based all of their list-type widgets upon this premise. I can tell you from personal experience that the ListView widget won't work if you don't have an _id column in the cursor!

于 2012-05-09T04:55:18.870 に答える