Bde.DBTables.TSession.AddPassword

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
Bde.DBTables.pas
Bde.DBTables.hpp
Unit: Bde.DBTables
Parent: TSession

Delphi

procedure AddPassword(const Password: string);

C++

void __fastcall AddPassword(const System::UnicodeString Password);

Description

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

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.

See Also