Clear Access 97 password


Question

I forgot the database password of my Access 97's database. How can I clear it?

Answer

Use this code:

Private Const cintAcc97PwdOffset As Integer = &H43

Public Sub smsAcc97PwdClear(ByVal vstrMdbPath As String)
'*+
'
'  Purpose:    Clear MS Access 97 database level password even on encripted mdb
'  Written by: Shamil Salakhetdinov
'  e-mail:     shamil@marta.darts.spb.ru
'
'  Parameters:
'               vstrMdbPath - full path for MS Access 97 database
'
'  DISCLAIMER
'  ==========
'
'  You can use this sub on your own risk only - Neither the author
'  nor any redistributors assumes any liability for any alleged or actual
'  damages arising from the use of this sub.
'
'  Don't forget to make backup copy of your mdb before you use this sub!
'  Happy hacking...
'
'  Note:
'
'  This sub shows that MS Access 97's database level password isn't enough
'  to secure your mdb.
'
'*-
    On Error GoTo smsAcc97PwdClear_Err
    
    Dim intFn As Integer
    Dim strClearPwd As String
    
    strClearPwd = Chr(&H86) & Chr(&HFB) & Chr(&HEC) & Chr(&H37) & _
                  Chr(&H5D) & Chr(&H44) & Chr(&H9C) & Chr(&HFA) & _
                  Chr(&HC6) & Chr(&H5E) & Chr(&H28) & Chr(&HE6) & _
                  Chr(&H13)  ' trailing baker's dozen ;-)
                  
    intFn = FreeFile
    Open vstrMdbPath For Binary Access Write As #intFn
    Put #intFn, cintAcc97PwdOffset, strClearPwd
    Close intFn

smsAcc97PwdClear_Exit:
    Exit Sub
smsAcc97PwdClear_Err:
    MsgBox "smsAcc97PwdClear: Err = " & Err & " - " & Err.Description
    Resume smsAcc97PwdClear_Exit
End Sub

 


Copyright 1999-2008 by Shamil Salakhetdinov. All rights reserved.