SQLite reports no such table error solution)

Source: Internet
Author: User

15:18:12| Category:Default category| Tag: |Font SizeLargeMediumSmall Subscription

SQLite is used in the C/S project over the past two days. This little item is really useful. The access speed is fast, and the generated database files are also small. Suitable for databases of small projects. It is strongly recommended in wince.

However, today, we have a big problem. When we delete data, the system prompts no such table.

The table in the database clearly exists, and there is no problem in executing the delete SQL statement in the database. It does not appear to be a problem with SQL statements.

However, there was a form that used the same method as the current form. How can we use the previous form?

After analyzing the differences between the two forms, we find that the former is show and the latter is showdialog. Is the problem here?

Debugging is not clear.

This is because datasoure = "DB" is written when I connect to the database, while the show form is searched under debug, And the showdialog form is not.

Therefore, the solution is to construct the physical path of the database after datasoure. As for how to construct the path, try to solve the problem. If it is written as the default path, your project will not be used after release.

The problem is solved, but the first thought is, Will SQLite make such a mistake? Why can't I find the database but report the error "cannot find the table?

Debugging found that a new database will be automatically created when SQLite could not find the database (Note: I am using SQLite. Data)

It turns out that the error is clear.

Related Article

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.