SQLite database password protection: feasibility discussion
Q: Can a SQLite database be password protected like an Access database?
Answer: Yes. SQLite databases can be password protected. A user password must be set before any database operations can be performed.
In C#, you can use the following code:
SQLiteConnection conn = new SQLiteConnection("Data Source=MyDatabase.sqlite;Version=3;"); conn.SetPassword("password"); conn.Open();
Subsequent database access can use the following code:
conn = new SQLiteConnection("Data Source=MyDatabase.sqlite;Version=3;Password=password;"); conn.Open();
Other instructions:
ChangePassword()
method. ChangePassword(String.Empty)
to reset or remove your password. The above is the detailed content of Can SQLite Databases Be Password Protected?. For more information, please follow other related articles on the PHP Chinese website!