RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSession.AddPassword Method

Adds a password to the current session for accessing encrypted Paradox or dBase tables.

Pascal
procedure AddPassword(const Password: string);
C++
__fastcall AddPassword(const AnsiString Password);

Call AddPassword to provide a password for a session prior to opening an encrypted Paradox or dBase table that requires a password. If an application opens a table that requires a password for access, the session does not have a password assigned to it, and the application does not provide its own OnPassword event handler, the library displays a dialog box prompting the user for a valid password before allowing table access. 

For example, to provide the String literal "secret" as a password for the session:

Session.AddPassword('secret');

 

Session->AddPassword("secret");

Note: If an application defines its own OnPassword event handler, the handler should call this method to add passwords for the session. All passwords assigned by AddPassword should be deleted with RemoveAllPasswords or RemovePassword before an application closes.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!