AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi Paradox Tabelle mit Passwort
Thema durchsuchen
Ansicht
Themen-Optionen

Paradox Tabelle mit Passwort

Ein Thema von Mauli · begonnen am 31. Jul 2003 · letzter Beitrag vom 13. Sep 2003
 
Benutzerbild von APP
APP

Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
 
Delphi 7 Enterprise
 
#2

Re: Paradox Tabelle mit Passwort

  Alt 1. Aug 2003, 06:50
Hallo,

Zitat:
To assign a password to a Paradox table, use the following unit and call function TablePasswort like this:

uses Unit2;
// ..
TablePasswort (Table1, 'secret');
Delphi-Quellcode:
unit Unit2;

interface

uses
  BDE, SysUtils, DBTables, Windows;

function TablePasswort(var table: TTable; password: String) : Boolean;

implementation

function StrToOem(const AnsiStr: String) : String;
begin
  SetLength(result, Length(AnsiStr));
  if Length(result)>0 then
    CharToOem(PChar(AnsiStr), PChar(result))
end;


function TablePasswort(var table: ttable; password: String) : Boolean;
var
  pTblDesc : pCRTblDesc;
  hDb : hDBIDb;
begin
  result := false;
  with table do
  begin
    if Active and (not Exclusive) then
      Close;
    if (not Exclusive) then
      Exclusive := true;
    if (not Active) then
      Open;
    hDb := DBHandle;
    Close
  end;
  GetMem(pTblDesc, sizeof(CRTblDesc));
  FillChar(pTblDesc^, sizeof(CRTblDesc), 0);
  with pTblDesc^ do
  begin
    StrPCopy(szTblName, StrToOem(table.tablename));
    szTblType := szParadox;
    StrPCopy(szPassword, StrToOem(password));
    bPack := true;
    bProtected := true
  end;
  if DbiDoRestructure(hDb, 1, pTblDesc, nil, nil, nil, false)<>DBIERR_NONE then
    exit;
  if pTblDesc<>nil then
    FreeMem(pTblDesc, sizeof(CRTblDesc));
  result := true
end;


end.
Quelle: Assign a password to a Paradox table
Armin P. Pressler

BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz