🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1016

Re: set access 2000 mdb file password

#1016
From: Viatcheslav V. Vassiliev
Date: Mon, 06 Dec 2004 19:14
45 lines
2412 bytes
Set property "Jet OLEDB:Database Password" to existing password and "Jet
OLEDB:New Database Password" to new password. Or compact database with new
password. In Delphi this looks as:

uses
    ADOX_tlb;

procedure TForm1.Button1Click(Sender: TObject);
var
 engine: IJetEngine;
 src, dst, path: WideString;
begin
 path := ExtractFilePath(ParamStr(0));
 //src is connection string to existing database with old password
 src := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + path + 'test.mdb'
+
  ';Jet OLEDB:Database Password=oldpassword';
  //dst is connection string to compacted db with new password
 dst := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + path +
'compacted.mdb' +
  ';Jet OLEDB:Database Password=newpassword';

 engine := CoJetEngine.Create();
 engine.CompactDatabase(src, dst);
end;

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"neeme" <neeme2003@hotmail.com> �������/�������� � �������� ���������:
news:41af222d@newsgroups.borland.com...
> Hi:
>
>   I use BCB 5.0  with  ADO.
>
>   How can i set or change password for mdb file?
>
>   Thank you!
>
>
Technical Details
Message-ID: <41b4afa8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41af222d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,d99d5d62f370164e
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <41af222d@newsgroups.borland.com>
Subject: Re: set access 2000 mdb file  password
Date: Mon, 6 Dec 2004 22:14:46 +0300
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 217.73.240.66
Message-ID: <41b4afa8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1102360488 217.73.240.66 (6 Dec 2004 11:14:48 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail