Solved

Change access password with Delphi

Posted on 2004-08-02
5
1,473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

617 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