View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Open PW-Protected MS Access db using Excel VBA

I have code set up to open an Access database from within Excel using a VB
module. It works, but now I want to add a password to the Access database
and I can not figure out how to do it. Below is the open routine. What do I
need to add to it so it opens it with a password.

Sub OpenMsAccess()
Dim AccessApp As Object

Set AccessApp = CreateObject("Access.Application")
AccessApp.Visible = True
AccessApp.OpenCurrentDatabase "C:\TestDir\TestDb.mdb"
'process data
AccessApp.Quit
Set AccessApp = Nothing

End Sub