mahdiparak
asked on
Change Access Databse Password
Hi Experts
How I can Change MSAccess Password In Delphi?
How I can Change MSAccess Password In Delphi?
Hi, are you using ADO? Try
ALTER DATABASE PASSWORD MyNewPassword MyOldPassword
e.g.:
ADOCommand1.CommandText := 'ALTER DATABASE PASSWORD MyNewPassword MyOldPassword';
ADOCommand1.Execute;
see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp
and you might want to have a look at
https://www.experts-exchange.com/questions/21900292/Protect-access-database-with-password.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
copying the solution
var
db1, db2, fp1, fp2 : string;
begin
db1:='c:\test\test.mdb'; // original flename
db2:='c:\test\new.mdb'; // new filename
fp1:='password'; //original file password
fp2:='password'; //new file password
try
StatusBar.SimpleText:='Loa
v := CreateOLEObject('JRO.JetEn
try
v.CompactDatabase('Provide
';Persist Security Info=False' + fp1,
'Provider=Microsoft.Jet.OL
'x; Jet OLEDB:Engine type=5'+ fp2);
except
on E:Exception do
ShowMessage(E.Message);
end;
finally
v := Unassigned;
StatusBar.SimpleText:='Don
end;
end;
sun4sunday