Results 1 to 2 of 2

Open a password protected accdb file with VBA

Threaded View

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Indy
    MS-Off Ver
    Excel 2010
    Posts
    33

    Open a password protected accdb file with VBA

    I'm trying to open an access database with some VB code. The following code I have works but only for 2003 format. What could can I use to open up the .accdb format?

    Public objaccess As DAO.Database
    Public ws As DAO.Workspace
    
    Sub main()
    
        Set ws = DBEngine.Workspaces(0)
    
        Set objaccess = ws.OpenDatabase("C:\Users\CNOIFX\Desktop\Files_from_C_drive\Hantleman.mdb", False, False, "MS Access;PWD=ppgroomer")
    
    End Sub
    Last edited by Cutter; 09-20-2012 at 07:50 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1