I need to open a password protected database I have tried many different solution none of them have worked this is what I have:
Set objaccess = CreateObject("Access.Application")
With objaccess
.OpenCurrentDatabase "\\vitefpsrv\a368270$\B17Cv1.0s.mdb"
.DoCmd.OpenReport reportname:=rep2, view:=acPreview
.Visible = True
.DoCmd.Maximize 'maximizes the Report window
.DoCmd.Maximize 'maximizes Access window
End With
Set objaccess = Nothing
Set objaccess = CreateObject("Access.Application")
With objaccess
.OpenCurrentDatabase "\\vitefpsrv\a368270$\B17Cv1.0s.mdb"
.DoCmd.OpenReport reportname:=rep2, view:=acPreview
.Visible = True
.DoCmd.Maximize 'maximizes the Report window
.DoCmd.Maximize 'maximizes Access window
End With
Set objaccess = Nothing