Hi
I´m using UniDAC 4.3.8
I do not know how to validate the password. Can someone help me with an example of code is needed to indicate if the entered password is correct or not?
Thanks in advance
Encrypted Sqlite: password validation on screen
Re: Encrypted Sqlite: password validation on screen
hello,
When attempting to connect to an encrypted DB, password is validated by the library, and you cannot validate the password by yourself. You can wrap the Connect method call with a Try...Except block and analyze the codes of the occurred errors. I.e.:
P.S. Retrieving of error code in this version is available only when working with the client library. We will add this functionality in the next build. For the time being, the following error is returned in the Direct mode:
'Invalid EncryptionKey and/or EncryptionAlgorithm specified" with no code.
When attempting to connect to an encrypted DB, password is validated by the library, and you cannot validate the password by yourself. You can wrap the Connect method call with a Try...Except block and analyze the codes of the occurred errors. I.e.:
Code: Select all
UniConnection1.SpecificOptions.Values['EncryptionKey'] := 'test';
try
UniConnection1.Connect;
except
on E: EUniError do
case E.ErrorCode of
26: ShowMessage('Invalid Password');
else
ShowMessage('Other Error');
end;
end;'Invalid EncryptionKey and/or EncryptionAlgorithm specified" with no code.