Board index » delphi » Paradox Password/Encrypt

Paradox Password/Encrypt

How can I programmatically encrypt/password protect a paradox table.

Thanks Helmut

 

Re:Paradox Password/Encrypt


In article , "Helmut says...

Quote

>How can I programmatically encrypt/password protect a paradox table.

>Thanks Helmut

In Delphi 1 I use this function, a modified Pack Table function.

{ used to add a password }
procedure PackTable(DataBaseName, TableName, Password: string);
var
  DataBase : TDataBase;
  TableDesc: CRTblDesc;
begin
        { get the database handle }
  DataBase := Session.OpenDataBase(DataBaseName);
  FillChar(TableDesc, SizeOf(TableDesc), 0);
  with TableDesc do
  begin
    StrPCopy(szTblName, TableName);
    StrCopy(szTblType, szParadox);
    bPack := true;                   {pack table }
    if length(Password) > 0 then
    begin
      bProtected := true;
      StrPCopy(szPassword, Password);
      Session.AddPassword(Password);  
    end {if length(Password) > 0 then}
  end; {with TableDesc do}
  Check(DbiDoRestructure(DataBase.Handle, 1, @TableDesc, Nil, Nil, Nil,
false));
end; { end of PackTable }

You will to add some of the following to the uses clause, I can't remember
exactly which ones.

  Db, DbiProcs, DbiErrs, DBiTypes

HTH
David Arnall

Re:Paradox Password/Encrypt


Thanks,

You put me on the right track
Helmut

David Arnall wrote in article <5te49h$...@drn.zippo.com>...

Quote
> In article , "Helmut says...

> >How can I programmatically encrypt/password protect a paradox table.

> >Thanks Helmut

> In Delphi 1 I use this function, a modified Pack Table function.

> { used to add a password }
> procedure PackTable(DataBaseName, TableName, Password: string);
> var
>   DataBase : TDataBase;
>   TableDesc: CRTblDesc;
> begin
>         { get the database handle }
>   DataBase := Session.OpenDataBase(DataBaseName);
>   FillChar(TableDesc, SizeOf(TableDesc), 0);
>   with TableDesc do
>   begin
>     StrPCopy(szTblName, TableName);
>     StrCopy(szTblType, szParadox);
>     bPack := true;                   {pack table }
>     if length(Password) > 0 then
>     begin
>       bProtected := true;
>       StrPCopy(szPassword, Password);
>       Session.AddPassword(Password);  
>     end {if length(Password) > 0 then}
>   end; {with TableDesc do}
>   Check(DbiDoRestructure(DataBase.Handle, 1, @TableDesc, Nil, Nil, Nil,
> false));
> end; { end of PackTable }

> You will to add some of the following to the uses clause, I can't
remember
> exactly which ones.

>   Db, DbiProcs, DbiErrs, DBiTypes

> HTH
> David Arnall

Other Threads