Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi and a password protected access database

Status
Not open for further replies.

XGAEREC

Programmer
Jul 22, 2005
2
IT
Hi
I use Delphi 7 and MS-Access for an application. I have protected database using a "database password".
But I don't succeed to open the so protected database from Delphi. I use a connection
string similar to <Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\PostazioneDatabase\DBMessaggi.mdb;Mode=Share Deny None;Extended Properties="";Persist Security Info=False;Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False> to connect the database and obviously I obtain error (i must give password).
But if I write password in the connection string, I obtain an error saying "information file "Il file di about job group is not found or open from another user in exclusive mode".
The question is : how can I do to open the protected database from Delphi (I repeat database access is protected by a password database

Thank you

Gaetano Recchi
 
I use the following connection string and it works fine:


procedure TfmData.DataModuleCreate(Sender: TObject);
const
ConnStr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;Persist Security Info=False;Jet OLEDB:Database Password=MyPassword';
begin
ADOConnection1.Close;
ADOConnection1.ConnectionString := Format(ConnStr,[ ExtractFilePath(ParamStr(0))+'MyDataBase.mdb' ]);
ADOConnection1.Open;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top