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.