Discussion:
Database Password Problem
(too old to reply)
ÈÇÈß
2006-10-08 17:34:26 UTC
Permalink
Hi
I create a *.db by Database desktop,
Its has two frields, First one name is Alpha as Alphabetic
Second one named Beta as Numberic
Then I make Aplha as Index (No primary , no Alias, no other things)
and so *.px is created by Database Desktop.
After all I put a password ("MyPass") and Exit.

In my BCB5 I want to create a new Project and Open the file
but when I want to give the password to Table I saw there is no way for me.
I have to say that I searche the Internet and I found the Function below and
some weird things I couldn't understand,
This is my first exproence of password protecting Database file, how can I
give the password to my file to avoid showing any password window, I want to
code it myself, I never saw a source of opening password protect file.
Please someone guide me, I'll write the rest of my software by doing this
sample later.
Thanks to all
Antonio Felix
2006-10-09 07:56:48 UTC
Permalink
Post by ÈÇÈß
Hi
I create a *.db by Database desktop,
Its has two frields, First one name is Alpha as Alphabetic
Second one named Beta as Numberic
Then I make Aplha as Index (No primary , no Alias, no other things)
and so *.px is created by Database Desktop.
After all I put a password ("MyPass") and Exit.
In my BCB5 I want to create a new Project and Open the file
but when I want to give the password to Table I saw there is no way for me.
Hi,

You need to use TSession->AddPassword(...)

void __fastcall AddPassword(const AnsiString Password);

Description

Call AddPassword to provide a password for a session prior to opening an encrypted Paradox table that requires a password. If an application opens a Paradox 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, C++Builder 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");

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 the Online Help for further reference
HTH
Antonio
ÈÇÈß
2006-10-09 21:18:13 UTC
Permalink
I'm exteremely thankful, my vig problem is solved now :-)

Loading...