B4J Question B4J Change Cipher Password

Guenter Becker

Active Member
Licensed User
Longtime User
Hello Experts,
I like to change the Database Password by B4J Code.
Can anyone help me with a snipped.
Thank you in advance.
 

teddybear

Well-Known Member
Licensed User
What database are you using? how did you manually change the password?
 
Upvote 0

Guenter Becker

Active Member
Licensed User
Longtime User
What database are you using? how did you manually change the password?
Sorry forget that info. Using SQLiCipher Version 3 or 4.
Like to hava encrypted database with default apssword in my app but the user shoukd be able to set it's own password.
Thiis is how I like to know how to change Cipher Password by code.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Sorry forget that info. Using SQLiCipher Version 3 or 4.
Like to hava encrypted database with default apssword in my app but the user shoukd be able to set it's own password.
Thiis is how I like to know how to change Cipher Password by code.
Try this code, it should work.
B4X:
    sql.ExecNonQuery("PRAGMA key = 'oldpasswd'")
    sql.ExecNonQuery("PRAGMA rekey = 'newpasswd'")
 
Upvote 0
Top