Wednesday, April 18, 2012

Free Method To Open Password-Protected MS Access

Labeled (mdb/ms access) database icon with sho...
Labeled (mdb/ms access) database icon with shortcut identification (Photo credit: Wikipedia)
Password-Protected MS access 2000 database can be open without enserting password. This action can be performed with the use OpenCurrentDatabase method. But OpenCurrentDatabase method does not provide a parameter for specifying a password for password-protected databases. So you need to use Data Access Objects (DAO) method to specify database password then use OpenCurrentDatabase method to open MS access database.

Here I am going to explain step by step procedure to open access database. It is requested you to create backup of original database (sample.mdb) file and apply bellow written method on backup copy.

  1. First start Microsoft Access 2000.
  1. Open the sample database sample.mdb for exclusive use. To open the database for exclusive use, click sample.mdb in the Open dialog box, click the arrow next to the Open button, and then click Open Exclusive.
  1. On the Tools menu, point to Security, and then click Set Database Password.
  1. Type nwind in the Password and Verify boxes, and then click OK.
  1. Close the sample database sample.mdb.
  1. Open the sample database sample.mdb to verify that you receive a prompt to enter the database prompt.
  1. Click Cancel to prevent the database from opening.
  1. Create a new, blank database.
  1. Open a new module in Design view.
  1. On the Tools menu, click References.
  1. Add a reference to the Microsoft DAO 3.6 Object Library, and then click OK to close the References dialog box.
  1. Add the following code to the module:

Option Compare Database
Option Explicit
Sub OpenPasswordProtectedDB()
'Define as Static so the instance of Access
'doesn't close when the procedure ends.
Static acc As Access.Application
Dim db As DAO.Database
Dim strDbName As String
strDbName = "C:\Program Files\Microsoft Office\Office\Samples\sample.mdb"
Set acc = New Access.Application
acc.Visible = True
Set db = acc.DBEngine.OpenDatabase(strDbName, False, False, ";PWD=nwind")
acc.OpenCurrentDatabase strDbName
Set db = Nothing
End Sub

  1. Run the OpenPasswordProtectedDB subroutine in the Immediate window.

Now you will see that sample.mdb database will open without asking for password. This method works for MS Access 2000. This is very good but lengthy method, you must have some programing knowledge to impliment it. If you are in hurry then use access password recovery software to recover lost MS access password.
Enhanced by Zemanta

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...