[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Who to create a password protected table?

Posted on 2002-05-08
1
Medium Priority
?
159 Views
Last Modified: 2010-04-04
Can I create a password protected table(paradox) using createtable function? I need a example.
0
Comment
Question by:Seashore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 300 total points
ID: 6998204
Hello

  You can add password to paradox table using the BDE API, Here's an sample

uses
  Bde;

procedure AddMasterPassword(Table: TTable; pswd: string);

const
  RESTRUCTURE_TRUE = WordBool(1);
var
  TblDesc: CRTblDesc;
  hDb: hDBIDb;
begin
  if not Table.Active and not Table.Exclusive then
    Table.Close;
  if (not Table.Exclusive) then
      Table.Exclusive := true;
    if (not Table.Active) then
      Table.Active := True;
  FillChar(TblDesc, SizeOf(CRTblDesc), #0);
  with TblDesc do begin
    StrPCopy(szTblName, Table.TableName);
    StrCopy(szTblType, szPARADOX);
    StrPCopy(szPassword, pswd);
    bProtected := RESTRUCTURE_TRUE;
  end;
  Check(DbiGetObjFromObj(hDBIObj(Table.Handle), objDATABASE, hDBIObj(hDb)));
  Table.Close;
  Check(DbiDoRestructure(hDb, 1, @TblDesc, nil, nil, nil, False));
  Session.AddPassword(pswd);
  Table.Open;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  AddMasterPassword(Table1,'password');
end;

Best regards
Mohammed Nasman

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question