An error occurred while creating the database for SQLite.

Source: Internet
Author: User

An error occurred while creating the database for SQLite.

1. symptom: the database cannot be created,

Solution: The project package for testing ends with db, and it will be okay to recreate the project and change it to dbtest.

2. symptom: the database is created, but there are no table items in the database.

Solution:

Db.exe cSQL ("create table" + TABLE_NEWS_NAME + "(" + TABLE_NEWS_ID + "integer primary key autoincrement," + TABLE_NEWS_TITLE + "varchar (50 ), "+ TABLE_NEWS_SUMMARY +" char (50 ));");
Note that you must add a space in the quotation marks at the end of create table. Otherwise, an error will be reported when the table name and table name are serialized. This error is concealed by other parties !!


How can I create a database in sqlite?

Use sqlite3 d:/test. db before going to sqlite>
C: \ Windows \ system32> sqlite3 test. db

Android SQLite database creation Problems

Is your SQL incorrect? The varchar behind the password does not have a defined size, and there are also half of the brackets missing. Why not inherit SQLiteOpenHelper to create it directly?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.