Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set a password on a paradox table at run-time?

11 views
Skip to first unread message

HdV

unread,
May 26, 1997, 3:00:00 AM5/26/97
to

Hi,

I couldn't find any info on this subject in the documentation, maybe
someone in this newsgroup can help me out.

I'd like to be able to create a password protected paradox table at
run-time. Well, creating a table at run-time that's quite simple but I
can't find any instructions on what function to use to set the
password for paradox tables..

Thanks for your time.

P.S. could you mail any answers to my mailbox also:
J.A.d...@lr.tudelft.nl

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bees accomplish nothing
save as they work together,
and neither do men.
(Elbert Hubbard)


HdV aka J.A.d...@lr.tudelft.nl
Delft University of Technology
Faculty of AeroSpace Engineering


John Malia

unread,
May 28, 1997, 3:00:00 AM5/28/97
to

Look at the BDE help for DbiDoRestructure !!!!

HdV <J.A.d...@lr.tudelft.nl> wrote in article
<5md694$lrm$1...@news.tudelft.nl>...

Kirk B. Spadt

unread,
May 30, 1997, 3:00:00 AM5/30/97
to

In article <5md694$lrm$1...@news.tudelft.nl>,
J.A.d...@lr.tudelft.nl (HdV) wrote:

>I'd like to be able to create a password protected paradox table at
>run-time. Well, creating a table at run-time that's quite simple but I
>can't find any instructions on what function to use to set the
>password for paradox tables..

I use this procedure to register a password with an existing table and to
encrypt it. I wrote it to work with Paradox tables connected using a
TDatabase on the main form of the application that has a BDE alias assigned
to it.

- - - - the procedure - - - -

uses
DbiTypes, DbiProcs, DbiErrs;

procedure EncryptTable(Database: TDatabase; const TblName: String;
const Password: String);
var
TblDesc: CRTblDesc;
AliasName: DBIName;
hDB: hDbiDB;
begin
FillChar(TblDesc, sizeof(CRTblDesc), #0);
StrPCopy(TblDesc.szTblName, TblName);
StrCopy(TblDesc.szTblType, szParadox);
StrPCopy(TblDesc.szPassword, Password);
TblDesc.bProtected := True;
StrPCopy(AliasName, Database.AliasName);
Check(DbiOpenDatabase(AliasName, 'STANDARD', dbiReadWrite, dbiOpenShared,
Nil, 0, Nil, Nil, hDB));
Check(DbiDoRestructure(hDB, 1, @TblDesc, nil, nil, nil, False));
Check(DbiCloseDatabase(hDB));
end;

- - - - Usage - - - -

To set the password and encrypt a (previously unprotected) table named
Custmast with its TDatabase assigned as DatabaseMaster using password
"secretkey", do this:

EncryptTable(DatabaseMaster, 'Custmast', 'secretkey');

-Kirk

------------------------------------------------
Kirk B. Spadt ksp...@keyware.com
Keyware Systems, Inc.
570 Lindsey Drive (610) 964-9530
Radnor, PA 19087 (610) 964-0543 fax

0 new messages