Solved

Change access password with Delphi

Posted on 2004-08-02
5
1,430 Views
Last Modified: 2009-07-29
Is it possible to change or take away an access password if I know what the current password is? One of my users have a corrupt mdb file. The file is password protected. He needs to open the file to check if he can save the data somehow. He is reluctant to send me the file because it contains sensitive information. I do not want to give him the password. He is threatening to find a password cracker unless I give him the password. I am actually not sure what to do about this. Any good ideas? Thanx in advance!
0
Comment
Question by:skynergy
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11701011
try following sql:

ALTER DATABASE PASSWORD OldPassword NewPassword

sorry, can't test myself

meikl ;-)

0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 11701619
there are some tools that lets you know the password of a MSAccess database in miliseconds. You must pay for some of them, but if you search, there are still some free utilities .. like this

http://www.snapfiles.com/download/dldbpwsniffer.html

If the database is corrupted, most sure Access couldn't open it to change the password itself.

Edu
0
 
LVL 22

Assisted Solution

by:Mohammed Nasman
Mohammed Nasman earned 60 total points
ID: 11701726
Hello

  The simplest way as Meikl said, but you need reverse the order of password like
ALTER DATABASE PASSWORD NewPassword OldPassword

Use TAdoCommand Control to use that, and it should open the database as exclusive mode,

Here's the sample

procedure TForm1.Button1Click(Sender: TObject);
begin
  ADOCommand1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db.mdb;'
        + 'Mode=Share Deny Read|Share Deny Write;Jet OLEDB:Database Password=aaa';
  AdoCommand1.CommandText := 'alter database password mmm aaa';
  AdoCommand1.Execute;
end;

HTH

Regards,
Mohammed
0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 11701833
In other way of things .. you can develop an application which creates an Access object that tries to compact and repair it or tries to export the data to some other format.

Edu
0
 
LVL 1

Accepted Solution

by:
aruana earned 65 total points
ID: 11715456
send your user a simple compact and repair utility.
create a simple application using this code on a button somewhere.

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:='Loading driver...';
    v := CreateOLEObject('JRO.JetEngine');
    try
      v.CompactDatabase('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + db1 +
                        ';Persist Security Info=False' + fp1,
                        'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + db2 +
                        'x; Jet OLEDB:Engine type=5'+ fp2);
    except
    on E:Exception do
           ShowMessage(E.Message);
    end;
  finally
    v := Unassigned;
    StatusBar.SimpleText:='Done.';
  end;
end;

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange code, can use it, but i cant figure out what it does. 3 65
delphi exception 7 68
How to debug For loops? 3 56
How to Get Images From Server using App Tethering 11 39
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

789 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