Need help on wxsqlite3.4.2.0
Posted: Mon Nov 05, 2018 4:37 am
I have downloaded wxsqlite3.4.2.0 and is facing the following problems:
1. I am unable to access database created in the earlier version (3.3.5.0) even if the database is not encrypted (i.e. password = '').
My code (lazarus freepascal, with zeolib database component) is as follows:
ZConnection1.Disconnect;
ZConnection1.Database := FileNameEdit1.FileName;
ZConnection1.Password := '';
// ZConnection1.ExecuteDirect(SELECT wxsqlite3_config("cipher", "aes256cbc"); //commented for non encryted db
ZConnection1.Connect;
Error message: 2. I can change the password of a database (created with wxsqlite3.4.2.0) with the following code:-
ZConnection1.Disconnect;
ZConnection1.Password := tx1Pass.Text; //existing password
ZConnection1.Connect;
if ZConnection1.Connected then
begin
zConnection1.ExecuteDirect('PRAGMA rekey =' + QuotedStr(tx2Pass.Text) + ';'); //only works if tx2pass.text is not blank
ZConnection1.Commit;
Showmessage('Password changed to: ' + #13 + tx2Pass.Text);
end
else
Showmessage('Unable to change key because database is not connected');
However, if I changed the password to '' (blank) then I won't be able to open tables in the database. The following error message will be displayed: All the above codes work fine when I use wxsqlite3.3.5.0. Also, there are no problem the database is created with password using wxsqlite3.4.2.0.
Please help. Thank you.
1. I am unable to access database created in the earlier version (3.3.5.0) even if the database is not encrypted (i.e. password = '').
My code (lazarus freepascal, with zeolib database component) is as follows:
ZConnection1.Disconnect;
ZConnection1.Database := FileNameEdit1.FileName;
ZConnection1.Password := '';
// ZConnection1.ExecuteDirect(SELECT wxsqlite3_config("cipher", "aes256cbc"); //commented for non encryted db
ZConnection1.Connect;
Error message: 2. I can change the password of a database (created with wxsqlite3.4.2.0) with the following code:-
ZConnection1.Disconnect;
ZConnection1.Password := tx1Pass.Text; //existing password
ZConnection1.Connect;
if ZConnection1.Connected then
begin
zConnection1.ExecuteDirect('PRAGMA rekey =' + QuotedStr(tx2Pass.Text) + ';'); //only works if tx2pass.text is not blank
ZConnection1.Commit;
Showmessage('Password changed to: ' + #13 + tx2Pass.Text);
end
else
Showmessage('Unable to change key because database is not connected');
However, if I changed the password to '' (blank) then I won't be able to open tables in the database. The following error message will be displayed: All the above codes work fine when I use wxsqlite3.3.5.0. Also, there are no problem the database is created with password using wxsqlite3.4.2.0.
Please help. Thank you.