This morning, I was fixing a database problem. The SQLite database could not be opened, but there was still data in the database. How should I fix this database? My approach is:
First, you need to export the database script. I have performed the following operations through the sqlite3.exe command line tool:
The most important step is to generate an SQL script.
Then, open the script file through SQL Server, which is opened in SQL server2005.
In this process, I am bored with an error, that is, I put all the scriptsCodeI have been admitted to sqliteadmin and want to generate the original database according to the script code. In fact, this is not correct, because the SQLite database in the Android system is somewhat different from the database we generate through the script. Indeed, directly generated databases runProgramAn exception occurred. The correct method is that we can use the Android software we developed to let the software we developed generate an empty database and then export the empty database, copy the data insertion code in the SQL script code to sqliteadmin, and run the statement to generate an error-free database.
The above method is used to complete database repair and data export operations.