Solved

Change access password with Delphi

Posted on 2004-08-02
5
1,399 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
Sending Gmail through Delphi 3 91
How to call a form that is in a DLL  from an application? 13 64
Run video youtube webbrowse 10 57
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
A short film showing how OnPage and Connectwise integration works.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now