Rabu, 23 Oktober 2013

[MS_AccessPros] How to open an mdb whose vba code is password protected

 

What is the code to open, using VBA, an mdb of which you know the password that locks its vba project? (you know, the one that's set in the vba project's properties window)
For example, in the code below, how do you open the strPath database, if you know its vba password, when Protection = 1?
Sub ProcessDatabase(ByVal strPath As String)
    Dim vbc As VBIDE.VBComponent
    app.OpenCurrentDatabase strPath
    With app.VBE.ActiveVBProject
        If .Protection = 0 Then
            For Each vbc In .VBComponents
                ProcessModule vbc.CodeModule, strPath
            Next vbc
        End If
    app.CloseCurrentDatabase
End Sub

Giorgio

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar