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
HdV <J.A.d...@lr.tudelft.nl> wrote in article
<5md694$lrm$1...@news.tudelft.nl>...
>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