sqlite unable to open database file is encrypted or is not a database?
When you specify a password in the connection string, and the database already exists, SQLite assumes the database is encrypted and will try to decrypt it with said password. If you haven't set a password on the database yet, this will result in the "file is encrypted" error, because the supplied password can't be used to decrypt an unencrypted database.
You can either delete the database, and SQLite will create a new encrypted database using the password in the connection string. Or, you can encrypt your existing database using the ChangePassword()
method:
// Opens an unencrypted database
SQLiteConnection cnn = new SQLiteConnection("Data Source=c:\\test.db3");
cnn.Open();
// Encrypts the database. The connection remains valid and usable afterwards.
cnn.ChangePassword("mypassword");
Reference: Encrypting, decrypting and attaching to encrypted databases
file is encrypted or is not a database in SQlite Android
My mistake is wrong database format (not plain text). I have changed the database to .sqlite extension, then work fine.
Related Topics
Tilde Operator in Regular Expressions
PHP Curly Braces in Array Notation
Get_Result() Doesn't Work Even MySQLnd Is Enabled
PHP in Background Exec() Function
How to Get Current PHP Page Name
Increasing PHP Memory_Limit. at What Point Does It Become Insane
How to Enable --Enable-Soap in PHP on Linux
PHP and Microsoft Access Database - Connection and Crud
How to Download Large Files Through PHP Script
Max_File_Size in PHP - What's the Point
Check If Row Exists in the Database Before Inserting
Keeping Url Parameters During Pagination
How to Run the PHP Script at Scheduled Time