BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Database Password Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
ÈÇÈß
Guest





PostPosted: Sun Oct 08, 2006 10:46 pm    Post subject: Database Password Problem Reply with quote



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
Back to top
Antonio Felix
Guest





PostPosted: Mon Oct 09, 2006 8:10 am    Post subject: Re: Database Password Problem Reply with quote



"ÈÇÈß" <babak_info (AT) Dont (DOT) spam> wrote:
Quote:
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
Back to top
ÈÇÈß
Guest





PostPosted: Tue Oct 10, 2006 2:30 am    Post subject: Re: Database Password Problem Reply with quote



I'm exteremely thankful, my vig problem is solved now Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.