Solved

Change access password with Delphi

Posted on 2004-08-02
5
1,384 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:mnasman
mnasman 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

24 Experts available now in Live!

Get 1:1 Help Now