Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change access password with Delphi

Posted on 2004-08-02
5
Medium Priority
?
1,516 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 240 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 260 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

715 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