open accdr file protected with database password

Anonymous
2013-08-21T12:29:22+00:00

Hi dear

how can I open accdr file protected with database password  by another one accdb file (with VBA code) ?

regard

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

47 answers

Sort by: Most helpful
  1. Anonymous
    2013-09-15T20:19:30+00:00

    Hi dear

    Thanks alot , it's great

    1- why do you use of  Dumy database , what's it's work ?

    2- Is there any relation between Dumy database and  the password?

    3-Is ther anyway to lose the password like anybody copy the database when it is running and take the database without password or for example , can anybody ( or cracker ) takes the password from Dummy databse or etc ?

    regard

    1 - The dummy database allows us to open Access in runtime mode (that is, with the /runtime switch) without yest specifying the password (since we can't provide it on the command line).  You can't open Access in runtime mode without specifying a database to be opened; Access won't allow it.  So we create a dummy database to pass on the command line, with no database password.  Then, once that database is open, we get a reference to that instance of Access and use automation to close the dummy database and open the protected database, specifying the password.

    2 - There is no relationship between the Dummy database and the password.  It's an empty database.  If it doesn't already exist from a previous run of the procedure, the procedure creates it.

    3 - The password can't be stolen from the dummy database, because that database has no password.  If someone has a copy of the protected database, I  don't know how hard it is to crack the password, but I do know that it's a lot harder than it was in earlier versions of Access.  I doubt that copying the database while it's running would make it easier to recover the password, but I don't know the technical details of how this security is implemented, so I can't say for sure.  On the other hand, it seems reasonable that some sort of process observer could capture the password from memory at the moment the database is opened and the password is supplied.

    I'd be inclined to say that, anyone who has a copy of the protected database could, with sufficient effort, crack the password.  It's just a question of how much time and effort is required.  The security provided by the database password is not intended to protect national secrets or million-dollar assets.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-09-15T18:13:51+00:00

    The code below, though clumsy, works for me with a full installation of Access.  I don't know if it works with only the Access runtime installed; I suspect it may not, but please test it if you can.

    '------ start of code ------

    Sub StartPasswordedDatabaseRuntime( _

            strPathToDatabase As String, _

            Optional strPassword As String, _

            Optional strPathToRuntime As String, _

            Optional blnQuit As Boolean)

        ' Start a runtime database that has a database password.

        Dim appRT As Access.Application

        Dim strPathToDummy As String

        Dim blnStillOpen As Boolean

        Const Q As String = """"

        If Len(strPassword) = 0 Then

            strPassword = InputBox("Please enter password:")

        End If

        If Len(strPathToRuntime) = 0 Then

            strPathToRuntime = SysCmd(acSysCmdAccessDir) & "msaccess.exe"

        End If

        strPathToDummy = CurrentProject.path & "\Dummy.accdb"

        If Len(Dir(strPathToDummy)) = 0 Then

            Application.DBEngine.CreateDatabase strPathToDummy, dbLangGeneral, dbVersion120

        End If

        Shell _

            Q & strPathToRuntime & Q & " " & Q & strPathToDummy & Q & " /runtime", _

            vbNormalFocus

        Set appRT = GetObject(strPathToDummy)

        With appRT

            .CloseCurrentDatabase

            .OpenCurrentDatabase strPathToDatabase, , strPassword

        End With

        On Error Resume Next

        blnStillOpen = True

        Do While blnStillOpen

            DoEvents

            Err.Clear

            If appRT Is Nothing Then

                blnStillOpen = False

            ElseIf Len(appRT.CurrentProject.path) = 0 Then

                blnStillOpen = False

            End If

            If Err.Number <> 0 Then

                blnStillOpen = False

            End If

        Loop

        If blnQuit Then

            Application.Quit   ' if we're done here.

        End If

    End Sub

    '------ end of code ------

    Please note that the database where this code runs remains open, with the procedure code looping, while the runtime database is open.  I've tried various methods to release that database to user control and exit, but so far without success.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-09-06T08:05:40+00:00

    Hi dear

    Thanks for going to continue to look into this

    and

    1-can you give me a way to open it with shell command , when rename it to accdb format where it has database password ?

    2-in your previous cod , "oAccess.Visible = True" is not work correctly , it means that it can't hide the database window , why?

    regard

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-09-05T20:31:45+00:00

    2- OpenCurrentDatabase method can't open accdr file format.

    Drat!  I didn't realize that, but I see that you are right.   Even though an .accdr file is just the same as an .accdb format with the file-extension changed, Access refuses to open it using OpenCurrentDatabase.  That's annoying.

    I'm going to continue to look into this, but while I do, I can think of one rather crazy solution:  have the code temporarily rename the .accdr file to .accdb, and then invoke Access via Shell() -- or ShellWait() --  with the /runtime command-line switch to open it.  Then, after the new instance of Access closes, rename the file back to the original extension.  Crazy, yes?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-09-05T19:20:23+00:00

    Hi All

    1-if any way with other method like : use of Shell command , will be good

    2-boblarson'answer worked correctly for opening accdr file but without password protected

    that was :

    Dim strPath As String

    strPath = "YourPathToTheDatabaseIncludingFileNameAndExtensionHere"

    Application.FollowHyperlink strPath

    is there any way to add a command to support database password protected accdr file?

    regard

    Was this answer helpful?

    0 comments No comments