Articles   Members Online: 3
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to add a password to several Paradox tables in one step Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
password to several Paradox tables in one step 28-Oct-02
Category
Database Others
Language
Delphi 2.x
Views
106
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

How to add a password to several Paradox tables in one step

Answer:
1   
2   procedure BDEProtectTable(ATable: TTable; const APassword: string);
3   var
4     CurPrp: CURProps;
5     hDB: hDBIdb;
6     TableDesc: CRTblDesc;
7     DoEncrypt: boolean;
8     bExcl, bOpen: boolean;
9   begin
10    Check(DBIGetCursorProps(ATable.Handle, CurPrp));
11    DoEncrypt := (APassword > '');
12    with ATable do
13    begin
14      bOpen := Active;
15      bExcl := Exclusive;
16      if Active and not Exclusive then
17        Close;
18      if not Exclusive then
19        Exclusive := True;
20      if not Active then
21        Open;
22      {supply nulls (=default) for every optional parameter:}
23      FillChar(TableDesc, SizeOf(CRTblDesc), 0);
24      {supply indispensable parameters:}
25      AnsiToNative(DBLocale, TableName, TableDesc.szTblName, DBIMAXTBLNAMELEN - 1);
26      TableDesc.szTblType := CurPrp.szTableType;
27      {supply parameters for our action here:}
28      AnsiToNative(DBLocale, APassword, TableDesc.szPassword, 255);
29      TableDesc.bProtected := DoEncrypt; {supply False to decrypt}
30      hDB := DBHandle;
31      Close;
32      {do the restructure:}
33      try
34        Check(DBIDoRestructure(hDB, 1, @TableDesc, nil, nil, nil, False));
35      finally
36        Exclusive := bExcl;
37        Active := bOpen;
38      end;
39    end;
40  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC